jQuery in Action, 3rd edition
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
JavaRanch » Java Forums » Java » JSP
Bookmark "What Watch "What New topic

What's rtexprvalue=false good for?

john gunther

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:


Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1710
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.


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

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] [About Bear] [Books by Bear]
Mahboob Ali

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?
It's not a secret anymore!