wood burning stoves 2.0*
The moose likes Struts and the fly likes Unable to fetch Request Parameters in customized Interceptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to fetch Request Parameters in customized Interceptor" Watch "Unable to fetch Request Parameters in customized Interceptor" New topic
Author

Unable to fetch Request Parameters in customized Interceptor

prav gup
Greenhorn

Joined: Jun 15, 2013
Posts: 2
I have written a validation Interceptor, in which I am retrieving the parameters from parameterMap.



I am facing a problem when I am trying to fetch the value of params.get("searchValidationString"), it is returning Object, casting to String is giving Class cast exception



this check is returning false

and



this block is printing the reference instead of value.

I am unable to get the string value from the request parameter ,which I need in interceptor for comparison.
prav gup
Greenhorn

Joined: Jun 15, 2013
Posts: 2
I got the problem, problem is with the piece of code following:-
Object SearchString = params.get("searchValidationString");

this code returns the String[] instead of String. Casting it to the String[], then taking the [0] element solves the issue.
I am surprised to see that no one explains this in any interceptor example I have refered.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to fetch Request Parameters in customized Interceptor