ognl

Struts 2 - Accessing different properties on the ValueStack sharing the same name

Struts 2 will resolve all property names during view rendering against the top object in the ValueStack first. But how can one access a property with the same name on the object lower on the stack? Example: Let's say I have an Action class called MyAction and it has a a logDate property. In the view rendered after this action is invoke...

How to pass parameter to method call in Struts 2 OGNL

Hi Guru, I want to use a property as a param of an object's method. <s:property value="orderProductId" /> returns correct value (e.g. 1) <s:iterator value="%{order.getProductById(1).activations}"> gives me correct value too. But <s:iterator value="%{order.getProductById(#orderProductId).activations}"> doesn't. Not sure why #or...

template language for ASP.NET MVC

Hi, is there any template language for ASP.NET MVC like JSTL and OGNL? Thanks in advance. ...

OGNL Static fields not working in struts2

Not able to access static fields with OGNL with struts2 <s:checkbox name="operation" fieldValue="@com.xx.xxx.webapp.action.EntryAction@OPERATIONAL" /> The above turning to HTML as below <input type="checkbox" name="operation" value="@com.xx.xxx.webapp.action.EntryAction@OPERATIONAL" id="entry_operation"/> instead the static consta...

Error setting expression '' struts2

Error setting expression '' with value '[Ljava.lang.String;@17e0b22' ognl.ExpressionSyntaxException: Malformed OGNL expression: [ognl.ParseException: Encountered "" at line 1, column 0. above message shows up in my log file.Now I got rid of all the parameters with no names by disabling them and no param with blank name di...

Struts2 debug tag thinks toString() is udefined

Debug tag in Struts2 keeps getting this error. Any ideas what could cause this? FreeMarker template error! Expression stackObject.value.get(propertyName).toString() is undefined on line 58, column 122 in template/simple/debug.ftl. The problematic instruction: ---------- ==&gt; ${stackObject.value.get(propertyName).toString()?html} [on ...

simple OGNL projection required in struts2

Hello, I would like to create a really simple tag parameterized with a collections' ids something like the following: <s:url action="theaction" namespace="/" includeParams="all" id="histURL"> <s:param name="sources" value="sources.{id}"></s:param> </s:url> ${histURL} If I have say three Source objects defined in my Action class, h...

Nasty java.lang.NumberFormatException in struts2 ognl

im getting this nasty exception, the problem is that i cannot control the get string since it's done by a 3rd party app. Apparently the number is too long to be parsed as int... java.lang.NumberFormatException: For input string: "1286579871769" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at j...

How to use Java constantns as a parameter in a Struts 2 OGNL tag

Hi, I am ussing to recover a property from an object User in the session. The following expression works correctly: <s:property value="#session.ATRB_SESSION_USER.getAttribute('ATTRIBUTE_USER_NAME')"/> but those strings ATRB_SESSION_USER and ATTRIBUTE_USER_NAME are constatns defined in a class. How can I use the constant instead of th...