Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP page showing an XML response  RSS feed

 
Baba Bizlowsky
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody.

I'm trying to make an JSP page which in turn communicates with an Axis Web service which does some XML transformation. It is a demonstration web application, so please disregard it's possible total unusability.

The application works as follows: the user puts in some XML data in a text area, posts it, and the JSP page returns the transformed result and presents it to the user.

Everything works great, except one small hing (which I probably should know how to solve, shame on me) - I don't know how to show XML data inside a HTML page! The Web service doesn't convert the brackets in the &'s form, and the HTML always tries to interpret the XML tags! In the end I see only the text inside the elements...

Please help me. Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Run the text through a method that translates the braces to their HTML entity counterparts (< and > respectively).
[ June 04, 2004: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a perfect oppurtunity to write a custom action to perform this translation, or if you are using the JSTL, the <cut/> tag will perform this translation automatically.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!