Re: Runtime Expressions within Tag

2007-12-10 Thread Alberto A. Flores
In case anyone also needs this, I avoided this by using the tag (thus using the value stack). It worked just fine without adding the extra property to the Action class. Wes Wannemacher wrote: I don't think you are understanding what I am telling you... When you read a parameter directly, it wi

Re: Runtime Expressions within Tag

2007-12-10 Thread Alberto A. Flores
Thanks Wes, I understood what you meant in your first reply and I appreciate it. However I'm used to doing simple calculations on a JSP (like just adding a 1 to a guaranteed numeric value), independent of the Action class. I guess this is part of my coding techniques in using non-thread safe

Re: Runtime Expressions within Tag

2007-12-10 Thread Wes Wannemacher
I don't think you are understanding what I am telling you... When you read a parameter directly, it will be a string. It's pretty much the same as calling - request.getParameter("paramName"); (http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletRequest.html#getParameter(java.lang

Re: Runtime Expressions within Tag

2007-12-10 Thread Alberto A. Flores
Thanks Wes, No offense to this approach, but is this the only way to do additions (and for this matter, any other operations) within a struts2 tag?. This is simply not clean (e.g. adding a property to my action for a counter, etc). Thanks anyway! Alberto Wes Wannemacher wrote: #request.fo

Re: Runtime Expressions within Tag

2007-12-10 Thread Wes Wannemacher
#request.foo is going to evaluate as a j.l.String. If your action has a getter for foo, then just refer to it as "%{foo + 1}", conversely, if you are feeling confident, you can make a static call to parse it - "[EMAIL PROTECTED]@parseInt(#request.foo) +1}" -Wes On 12/10/07, Alberto A. Flores <[EM

Runtime Expressions within Tag

2007-12-10 Thread Alberto A. Flores
I'm currently migrating an app from Struts 1.x to 2.x and encounter this situation where I was calculating the tabIndex of a JSP on the fly (reusable JSP). In struts 1.x this was done using "/> ... According to the Struts2 documentation, non-string attributes are evaluated as expressions, s