Error - Parametersinterceptor - Setparameters
Contents |
ParametersInterceptor java.lang.Object com.opensymphony.xwork2.interceptor.AbstractInterceptor com.opensymphony.xwork2.interceptor.MethodFilterInterceptor com.opensymphony.xwork2.interceptor.ParametersInterceptor All Implemented Interfaces: Interceptor, Serializable Direct Known Subclasses: ActionMappingParametersInteceptor public class ParametersInterceptor extends MethodFilterInterceptor This interceptor sets error setting expression with value struts2 all parameters on the value stack. This interceptor gets all parameters
Parameters Interceptor Example Struts2
from ActionContext.getParameters() and sets them on the value stack by calling ValueStack.setValue(String, Object), typically resulting in
Com.opensymphony.xwork2.interceptor.parametersinterceptor Error
the values submitted in a form request being applied to an action in the value stack. Note that the parameter map must contain a String key and often
Unexpected Exception Caught Setting On Class Error Setting Expression With Value
containers a String[] for the value. The interceptor takes one parameter named 'ordered'. When set to true action properties are guaranteed to be set top-down which means that top action's properties are set first. Then it's subcomponents properties are set. The reason for this order is to enable a 'factory' pattern. For example, let's assume unexpected exception caught setting '_' on 'class that one has an action that contains a property named 'modelClass' that allows to choose what is the underlying implementation of model. By assuring that modelClass property is set before any model properties are set, it's possible to choose model implementation during action.setModelClass() call. Similiarily it's possible to use action.setPrimaryKey() property set call to actually load the model class from persistent storage. Without any assumption on parameter order you have to use patterns like 'Preparable'. Because parameter names are effectively OGNL statements, it is important that security be taken in to account. This interceptor will not apply any values in the parameters map if the expression contains an assignment (=), multiple expressions (,), or references any objects in the context (#). This is all done in the acceptableName(String) method. In addition to this method, if the action being invoked implements the ParameterNameAware interface, the action will be consulted to determine if the parameter should be set. In addition to these restrictions, a fla
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of com.opensymphony.xwork2.ognl.ognlvaluestack : error setting expression this site About Us Learn more about Stack Overflow the company Business error setting expression submit with value submit Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask interceptor-ref name= params Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign https://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html up How to Configure Parameter Interceptors? up vote 0 down vote favorite Hi In my Struts2 applicaion I have a Jsp page with some feilds , like this
blog, projects and photography of Eric Martin home blog projects http://www.ericmmartin.com/struts-2-parametersinterceptor/ photography about contact home / blog / Struts 2 ParametersInterceptor Apr 05 2008 5 Struts 2 ParametersInterceptor Are your logs being filled up with errors like: ERROR - ParametersInterceptor.setParameters(204) | ParametersInterceptor - [setParameters]: Unexpected Exception caught setting '_' on 'class com.company.web.MyAction: Error setting expression '_' with value '[Ljava.lang.String;@1491ddc' If so, it's error setting because Struts 2 is parsing the query string/post data and trying to "set" a value for each parameter it finds. I'm working on an Struts 2 application utilizing the jQuery JavaScript library for the UI and the Displaytag tag library for displaying tables. With jQuery, I'm using the "no-cache" option (cache: error setting expression false) on all Ajax calls, which adds "_=timestamp" to each request. Since I don't have a property called "_" in my Action class, I get an error (mentioned above) in my logs for each request. Same with Displaytag, except the parameters causing errors are in the form of "d-#-X", where "#" is a unique id (usually 4 or 5 digits) and "X" is either p, s or o. They are used to determine the page (p) and/or the table sort order (o for asc/desc and s for which column). The solution: configure Struts (struts.xml) to ignore these parameters: