IntelliJ Java IDE
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question from jsp spec Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "question from jsp spec" Watch "question from jsp spec" New topic
Author

question from jsp spec

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
The next lines are all legal quotations.
• <%= "Joe said %/>" %>
but the above looks illegal..I think it should be....<%= "Joe said %\>" %>
please coorect me...
tony lee
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
I have problems with nested stuff , like nested scripting, nested actions, ...
Could anyone tell me about the principle there?


SCJP2, SCWCD
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
For all such doubts, the best approach, IMO, is implementation.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Originally posted by shan java:
The next lines are all legal quotations.
• <%= "Joe said %/>" %>

Implementing for yourself is a good idea. It took me now 3 minutes to paste your code in a jsp of my test app in Tomcat -- start tomcat -- and search for generated code in the work-directory. So it might be time-saving for you too.
Here's the result. The <%= "Joe said %/>" %> is perfectly legal. The result in the generated java-file in the work-directory is:
out.print( "Joe said %/>" );
Why?
Because <%= "Joe said %/>" %> is like:
JspWriter out;
// lots of other code
//..
out.println ("Joe said %/>".toString());
This nested stuff is a very common feature in all flavours of web-development.
(With lotus-domino I have a technique where one has to write a lotus-formula-language which creates JavaScript and that generated JavaScript generates Html. Nice feature . But its no rocket science, if one time grasped the principles)
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Beware though -- trying something out is no replacement for careful exegesis of the spec. In my experience many application servers have their idiosyncrasies. They either refuse a perfectly legal JSP, or they manage to digest the most horribly invalid markup.
- Peter
 
 
subject: question from jsp spec
 
Threads others viewed
Different Output using setContentType
Comments: pg 41 of JSP specification
JSP expression
finding correct object in action
Quoting and Escape Conventions
IntelliJ Java IDE