Struggling with the <s:action .. /> tag

Tags:

Thanks to the comment left by Philip Luppens I have since taken another look at this tag and found a better way to do things. The entry below has been modified to reflect that improved method. I found that method here:

http://www.nabble.com/Re%3A--S2--s%3Aaction-in-value-stack--p21764311.html

I found this to be another doozey, certainly it was partly my fault as I didn't read the Struts2 documentation on this tag very well. The problem was there was only a very short description so I skipped to the examples as I thought they would be more informative. Unfortunatly the example is also misleading and a better way exists.

Anyway, this tag acts as a way to include the result of an action in your JSP. Think of it like this (although it doesn't work this way):


<jsp:include page='/mynamespace/myaction.action' />

Ok, so how do you use this tag, firstly here are the caveats about its use. Once you have these in your head your life will become easier: