This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes What's rtexprvalue=false good for? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "What Watch "What New topic
Author

What's rtexprvalue=false good for?

john gunther
Greenhorn

Joined: Jun 11, 2007
Posts: 1
I don't know why anyone would ever want to set this to anything other than true. Basically, if it is false (the default) I cannot set the attribute to anything other than "a static value known at compile time". Why would
such a restriction be a good thing? Can someone give an example where false works better than/is a better choice than/ true for this?

Note: these tags occur within tag library descriptor files, here is a snippet:

<tag>
...
<attribute>
<name>a</name>
<required>yes</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
...
</tag>


John
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi John,

It depends what is likely to be required. You may only restrict the value to
be assigned that is static and not dynamic(run time).

<rtexprvalue>=true means, it can be String literal or an expression that
results value to be assigned.


Thanks,


cmbhatt
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60743
    
  65

When the translation engine knows that an attribute value is going to be a static string there are certain optimizations it can take. The exact steps are container-specific as long as they comply with the specification. Also for such attributes, TEI translation-time validation can take place. I imagine that this is why the JSTL tags set trexprvalue to false for their var and scope attributes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mahboob Ali
Greenhorn

Joined: Oct 04, 2013
Posts: 3
if we use <rtexprvalue>false</rtexprvalue>
then it restrict the jsp engine don't allow expression language while taking attribute like as follows
eg:http://localhost:8080/scwcd5n/test.jsp?uname=Mahboob Ali
<mine:mytag wish="${param.uname}"> then we will get following exception saying
org.apache.jasper.JasperException: /test.jsp (line: 7, column: 0) According to TLD or attribute directive in tag file, attribute wish does not accept any expressions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's rtexprvalue=false good for?
 
Similar Threads
displat:table tag pls help me
Problem while Tag lib Up gradation
Problems making Struts/JSTL 1.2 site work with JSTL 2.0
Expression Language in Taglibs
custom tag and getAttribute