goenka
goenka

Reputation: 23

Struts2 -ognl Exception

I have a JSP page with an html form . i enter the value of the form fields and hit the submit button the control will go the Action class . My question here is for every field in the JSP page do i need to have a corresponding property in Action class with getters and setters .

I dont have any property defined in my Action class and am trying to fetch value's from the HTML field's . . . i get OGNL Exception

WARNING: Error setting expression 'Release Version Template' with value '[Ljava.lang.String;@4eb585' ognl.ExpressionSyntaxException: Malformed OGNL expression: Release Version Template [ognl.ParseException: Encountered " "Version "" at line 1, column 9.

Is there some workaround for this or should i edit my JSP?

Upvotes: 1

Views: 1869

Answers (1)

Thomas
Thomas

Reputation: 88707

No, you don't have to provide a property for every parameter you're sending with your request. After all it's just a warning that you get and I suspect the reason should be that development mode is enabled in struts.xml.

The warning above, on the other hand, seems to indicate that you're passing the value as the parameter name and thus you get the OGNL warning, so please check that (and maybe post the relevant part of your jsp).

You can also blacklist or whitelist parameters per application or per action but you'd still get warnings if you send those parameters and have development mode enabled.

Upvotes: 1

Related Questions