• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSTL - c:out escapeXml

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I get a string to print without html characters?

Here's my code:



it displays a "<b>Video upload complete</b><br>" on the screen.

could you tell me the reason.
i am using tomcat;
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not for me. You're setup is likely incorrect.

What does viewing the HTML reveal?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nina Anderson:
i am using tomcat;


Tomcat 4, I take it?
 
Nina Anderson
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have my laptop with me to look up the tomcat level, but I installed the tomcat back in Dec. 2007, so I'm guessing it's probably Tomcat 6.

Do it make a difference?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JSTL URI you are using is for JSTL 1.0. You should be using JSTL 1.1.

See the JSP FAQ for correct setup. Pay special attention to declaring the web.xml and the JSTL URIs.

This may not be your problem, but until your configuration is compatible, it makes no sense to diagnose further.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nina Anderson:
...
Do it make a difference?



Yes.
JSTL and EL are much newer than servlets, JSPs, and thus containers like Tomcat. In addition there are a couple versions of JSTL and they need to be matched up with containers that support the versions of the servlet and JSP specs that coincide with them.
 
Nina Anderson
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've verified that I'm using Tomcat 6.

So, I did the following:

1) changed my web.xml to version 2.5:




2) Replaced jstl-1.0.jar and standard.jar with jstl-2.0.jar


3) Used the new jstl source in my jsp


After making all these changes, nothing gets printed to the screen anymore.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nina Anderson:
...
After making all these changes, nothing gets printed to the screen anymore.



The first thing I do when faced with a blank screen is use the browser's "view source" feature to see if the problem is on the server side or if it's a problem with the resulting HTML source.
 
Nina Anderson
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I do view source, I see:



It does NOT look like the browser recognizes the jstl tags. This is too bizarre!!!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nina Anderson:
It does NOT look like the browser recognizes the jstl tags. This is too bizarre!!!

Browsers know nothing about JSTL or other JSP tags. They are interpreted on the server. All that is ever sent to the browser is plain old HTML.

This means that your setup is somehow incorrect and the JSTL tags are not being processing on the server as they should be. Check all your setup steps again.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic