File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Ignore Expression Language (EL) Evaluation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Ignore Expression Language (EL) Evaluation" Watch "Ignore Expression Language (EL) Evaluation" New topic
Author

Ignore Expression Language (EL) Evaluation

Edwin Ubongen
Greenhorn

Joined: Jul 01, 2011
Posts: 5
Hi,

I'm currently doing upgrade of our codes to the latest version. However, after migration, JSTL tags are working fine but our custom tags (that have their own EL evaluation) are not working anymore. The root cause is that the EL has been evaluated twice since EL is now enabled by default based on the latest version of web container and JSP.

I tried to set the web.xml with the codes below. The custom tags are working but the JSTL fails.
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-ignored>true</el-ignored>
</jsp-property-group>

Question: Is it possible to disable or ignore EL evaluation of the web container for our custom tags but remain enabled for JSTL?

Upgrade Details:
Web Container: From 2.3 to 2.5.
JSP: From 1.2 to 2.1.
JSTL: From 1.0.3 to 1.2.

Thanks!


Edwin
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

No. It's an all or nothing deal. You'll need to update your tags to modern standards. The EL has been evaluated by the JSP engine since JSP 2.0 was introduced almost 10 years ago.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Edwin Ubongen
Greenhorn

Joined: Jul 01, 2011
Posts: 5
Thanks for your suggestion.

Follow up question. One of the custom tags that fails when we used the latest version of JSTL and kept the el expression enabled is the struts-el tag library. Do you know how are we going to resolve/update this tag to new standards?

Thanks!
Edwin Ubongen
Greenhorn

Joined: Jul 01, 2011
Posts: 5
Can I just simply migrate from struts-el to regular struts?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

This is not the struts forum, I'll move this post there for you.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1004
>Can I just simply migrate from struts-el to regular struts?
Yes.

Just replace the tag import uri for the struts-el tag library with the one for the standard struts tag library.
The actual usage of the tag on your page should work unchanged.

From JSP2.0 onwards, EL expressions became runtime expressions for the container, so they can be used anywhere you can use <%= scriptletExpressions %>

In JSP1.2 it had to be a String which was then interpreted as an EL expression. Which is why none of the EL tags accepted standard runtime expressions, because it would have been overly confusing.


 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Ignore Expression Language (EL) Evaluation
 
Similar Threads
Struts and JSTL
el-evaluation? or el-ignored? Which is correct
Struts EL Issue on Web Container 2.5 and JSP 2.1
EL Mock Question
jsp-property-group error in web.xml