Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question from jsp spec

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have problems with nested stuff , like nested scripting, nested actions, ...
Could anyone tell me about the principle there?
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For all such doubts, the best approach, IMO, is implementation.
- madhav
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic