• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comments: pg 41 of JSP specification

 
Goan Balchao
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is in reference to chapter 2 of JSP specification.
The following in shown as legal
<% String joes_statement ="hi!"; %>
<X:tag value='<%="Joe said \\"" + joes_statement + "\\"."%> '/>
How is this legal? I tried only the scriptlet part
i.e
<%="Joe said \\"" + joes_statement + "\\"."%>
and Tomcat(4.1) spewed a few errors
Can anyone please explain?
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Akasmat"
Your name doesn't follow the javaranch guidelines. Please take a moment and change your "Publicly Displayed Name" by modifying your profile. You can review the guidelines at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- satya
 
Stefan Zoerner
Author
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
You made a mistake by cutting just the scriptlet. It is valid when place in an '...'-Context of an attribute. Review the following code:

The page compiles. The scriptlet does not need the espaced "\", the usage in the useBean-tag does.
Hope that helped,
Stefan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic