I want to know if Tamino can capture my carriage return in my documents. That is, I have documents like,
abc (here is a return)
1. def (here is a return)
But after I inserted into tamino, and retrieve using X-Application, how can I change the carriage return to “
” but with no success. I suppose it use the java carriage return “\n”, isn’t it?
If you have a line break within your document (text content of an element) and you want to display this text with X-Appication’s JSP tags, you can set the attribute rawcontent=“true” within your xapp:display tag.
The effect is that the text content is not normalized. However, line breaks are not transformed to HTML tags like
If not, a ‘Plugin’ which overwrites the default behavior of the ‘getValue’ method could be a solution. A Plugin is a static Java method. This method could read the text of an element are replace the “\n” by an “
I’m afraid, the rawcontent=“true” is not working properly, at least in my side. Unless my line break is already ignore when the documents are inserted. I can’t see there is any \n (by view html source), if it has, I believe I can see the text contains next line, rather than a 1-line paragraph.
excuse my late reply and that I was not aware of the problem with XApplication 3.1.3 and JDOM Beta 6.
This problem was discussed by a former topic
Perhaps, switching to JDOM Beta 8 will solve your problems when using rawcontent=“true”.
I will please my colleague Throsten to send you this fix.
Good, at least I know that the problem can be solved!
Thank you very much christian, hope to get the fix asap.
we have added a post in our contribution section,
containing the requested file you are looking for.
Hope this will help you.
Just follow this link: JDom beta 8 patch
Well, after applying the patch, I can see my documents contains new lines, rather than the before “1-line paragraph” (by html view source).
But I can’t replace the “\n” to “
”, my code should be correct because I can replace “10” to “100”, “1” to “
”, but not “\n” to “
”, it seems that I can’t find the “\n” out. I believe it should be quite easy to fix, but I don’t know the answer. Actually after processed by X-Application, is the carriage return represented by “\n”? Or something like " ", " "?? I tried most of these, but with no success. Someone know the answer please kindly help me.
Thank you very much!
I don’t know if there is a special encoding for the line break.
My propose is to save the HTML page you receive by your browser. Then, open the page with an editor with can switch to a HEX mode represenation of the displayed content.
Onother way to find out which character comes from Tomcat is to use sniffer which protocols the transfer between your browser and Tomcat.
I described the handling with a Sniffer for protocolling HTTP transfer between X-Application and Tamino. Have a look at this discription if you think if you want to use the HTTP sniffer.
Protocolling the HTTP transfer between Tamino and X-Application
The difference for your use case is: don’t use the HTTP sniffer as a proxy for Tamino but for Tomcat. The remote port for the sniffer is the Tomcat, e.g.
If you start the sniffer for instance at port 3500, your URL to invoke your application from your Browser is
You don’t have to change anything for your application or configuration!
Hope, this helps you to find out your coding problem.
thanks! I figured out what’s wrong, because I’m ignoring empty string by
if( from == null || from.trim().equals("") ) continue;
and “\n” is treated as equals("")? anyway, I solved it by a dirty workaround now:
thank you all.
you would at least have to have a “valid” document.
so, write the BR in any one of these two ways:
<BR></BR> or <BR />
hope this helps,