• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

What's rtexprvalue=false good for?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic