I am using struts 1.2.I want to enter the request parameters and action called into the database.All other requests which are going through that code need to insert data in Database.Will it be good to enter the request data like request parameters ,logged in user id from the customRequestProcessor? Will it slow down the application performance ?As there is only 1 request processor instance then will it slow down the performance of all requests as all request will insert data in database?
Share
When you have chosen to use struts, the criteria of that decision should have include it is web framework, and ease to create form, validation, etc, yes? When you extending struts class Action, you override method doExecute, you can still access to the HttpServletRequest from the parameter and within that method, you can insert all these data you want into database. I think this can be easily done and your design has a good abide to the standard design.
I think the aforementioned step is much easier than you create a new customRequestProcessor. In your situation, I don’t see a concrete reason to create a new request processor.
On the other hand, if you are concern about the performance, why bother to use struts at all if according to your requirements? My point is that, you can use only tomcat (or any other servlet container), write a simple servlet by extends HttpServlet and within method doPost(), access the HttpServletRequest from the parameter and write anything you want into database. If you want to measure performance of your customRequestProcessor and this simple servlet, I guess simple servlet will perform much faster.