• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to fetch Request Parameters in customized Interceptor

 
prav gup
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic