In struts, if any changes are made to before the request reaches to actionservlet, where you do the changes?

Questions by sadashivarao   answers by sadashivarao

Showing Answers 1 - 8 of 8 Answers

Prasanna

  • May 18th, 2006
 

In struts the first to recieve the request is Actionservlet. So, there is no chance for you to make changes before.

  Was this answer useful?  Yes

Jitendra

  • Jun 23rd, 2006
 

You can use a Filter Class for achieving this. However, this will not be a part of the Struts Framework. This is actually implementation of Intercepting Filter Design Pattern.

  Was this answer useful?  Yes

Shipra Dey

  • Nov 18th, 2006
 

I suppose ... We can do it by making a new class which will extend the RequestProcessor or TilesRequestProcessor whicever is mentioned in config file tag and give the path.I hope this will do

I think what you are looking for from this query is that you want some of your custom [application speicifc code to be in place before you processes a request], then it can be achieved in following two ways:--

1) via a filter [which is outside the boudary of struts]

2) overriding RequestProcessor class and using one of the various hooks [methods] provided by it [one popular one which might suit your purpose is:--

public boolean processPreprocess(javax.servlet.http.HttpServletRequest request,  javax.servlet.http.HttpServletResponse response)

Hope this helps !!!

Thanks,
Vinay

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions