aspose file tools*
The moose likes Servlets and the fly likes Using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Using "jsp:getProperty" action tag in custom tag attribute - Possible?" Watch "Using "jsp:getProperty" action tag in custom tag attribute - Possible?" New topic
Author

Using "jsp:getProperty" action tag in custom tag attribute - Possible?

Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Hi,
Is it possible to use

inside a custom tag attribute?
For example, I want something like this in my JSP Page:

In the Taglib descriptor, I have set rtexprvalue to true.
Thanks in advance,
------------------
Sandeep Desai
vgdesai@bom3.vsnl.net.in

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56


<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
The JSP 1.1 spec section 2.12.1 explicitly says that a request time attribute value has to have the form "<%= expr %>" or '<%= expr %>'. Section 2.13.3 says that <jsp:getProperty> "... places the value of a Bean instance property, converted to a String, into the implicit out object, from which you can display the value as output." It doesn't say anything about it being equivalent to "<%= expr %>", so it would seem that this shouldn't work.
However, in section 5.3.5 (the tag library descriptor) where the rtexprvalue attribute is documented, it only says "... dynamically calculated at runtime by a scriptlet expression". That would seem to me to be requiring the "<%= expr %>" syntax.
So is it suppposed to work? I'd say no. Does it actually work? Depends on how the developers of your servlet engine read the spec - we'd have to construct a test and look at the generate code (assuming it gets that far).

------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets
Website: http://www.philhanna.com


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Hi Phil,
Had tried this out!!
Unfortunately <jsp:getProperty> action tag doesnot seem to work.I think the following is the governing criteria

However, in section 5.3.5 (the tag library descriptor) where the rtexprvalue attribute is documented, it only says "... dynamically calculated at runtime by a scriptlet expression". That would seem to me to be requiring the "<%= expr %>" syntax.

Hence the only work around (which I can think off!!) is to use the getter method instead in the expression tag, like this :

Please let me know your opinion on this.
Regards,


------------------
Sandeep Desai
vgdesai@bom3.vsnl.net.in

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
 
 
subject: Using "jsp:getProperty" action tag in custom tag attribute - Possible?