• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpServletRequestWrapper Struts

 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I am facing some problem. Actually I have written a filter in which I am taking the request parametere and then setting that request parameter as a request attribute. I have used a HttpServletRequestWrapper in which I have changed the request.getParameter() so that this method will call request.getAttribute method(which will retrun the value I have previously set as request attribute.). Now the problem is if I do request.getparameter() in my jsp it is working fine . But if I use struts then it is not calling the HttpServletRequestWrapper.getParameter but is getting the parameters from actualrequest.getParameter(). Can anybody tell how to make struts use the HttpServeltRequestWrapper object.

Thanks for your help.

Sawan
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sawan,

Have you typecasted the request in action class to the corresponding wrapper class?
Regards
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
Thanks for reply. Correct me if I am wrong but I don't thing I need to type cast it. Actually I am writing the filter only coz I don't want to change my whole web application. In this filter I am removing the special characters.

Regards,
Sawan
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey friends ,
Help me out here. I checke the struts code and I think they are doing pageContext.findAttribute() to populate the form bean. Now the starange thing is in my jsp if I do

<%=request.getParameter("prDocument.strDescription")%>
<%=pageContext.findAttribute("prDocument.strDescription")%>
<%=pageContext.getAttribute("prDocument.strDescription", PageContext.REQUEST_SCOPE)%>

it returns the correct filtered value. But <bean:write > is returning the wrong one.

Is there any issue with the HttpServletrequestWrapper and Struts.

thnaks for help .

Sawan
 
reply
    Bookmark Topic Watch Topic
  • New Topic