Java

Struts 2 and JSTL EL Quirk

This is quite an odd one. Struts 2 comes with it’s own tag library for accessing properties of actions but I thought it would be interesting to see if you can access it via JSTL EL instead. In the Hello World example I naively tried ${name} and ${requestScope.name}. Result: nada, as might be expected.

However if you reload the page (and repost the request) then suddenly the EL is populated! I presume that this is some artefact of re-executing the Action but it is very strange!

Update: this page set me right on how to mix JSTL EL and the Struts 2 Value Stack but I am still slightly mystified by what appears in which scope when the Result is returned.

Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s