aspose file tools*
The moose likes JSP and the fly likes What is the point of c:out  ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "What is the point of c:out  ?" Watch "What is the point of c:out  ?" New topic
Author

What is the point of c:out ?

Ivan Jouikov
Ranch Hand

Joined: Jul 22, 2003
Posts: 269
I see a lot of people using things like



Or



What the hell is the point? Isn't it easier to just do:



or



??? Same effect, why the extra writing?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
first: little point
second: that's the syntax before JSTL 1.1.
In JSTL 1.0 you could not embed EL directly in the code and have the output added to the output stream, it could only be used inside a tag.
As many servers don't support JSTL 1.1 (JSP 2.0) yet, and many people have gotten into the use to use cut, you'll continue to see it.
Myself I find the extra text using cut to add clarity, plus the project uses Tomcat 4.1 which doesn't support JSTL 1.1.


42
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Just an example of the ultimate in using JSP tags...
Small JSP which is completely prepared for i18n, not a single word of static text on the page.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Also, <cut/> will, by default, escape special HTML characters to their HTML entitiy equivalents.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: What is the point of c:out ?
 
Similar Threads
simple JSTL result does not display out - installation?
c:out JSTL tag of the core libaray of general purpose
problem with EL inside c:if test attribute="${x}"
JSP 2.0 EL and html:options issue
IE bug ? field too long ?