| Author |
Collaboration between Struts Actions and plain old Servlets
|
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
Hi all, What would be the preferred way to combine the use of Struts Actions and regular Servlets inside a web application? The situation is that I have a bunch of Struts Actions handling most of the web app but there's one Action I'd like to be doing something along these lines: 1) verify some user privileges (using a method in my abstract "BaseAction" class) 2) forward the request/response to a Servlet Obviously I could just use RequestDispatcher#forward(request, response) but what should the Action's execute() method then return instead of an ActionForward instance as I usually do?
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
I am not sure whether this will help http://www.jguru.com/faq/view.jsp?EID=471961
|
Groovy
|
 |
Karthik Guru
Ranch Hand
Joined: Mar 06, 2001
Posts: 1209
|
|
Originally posted by Lasse Koskela: 2) forward the request/response to a Servlet Obviously I could just use RequestDispatcher#forward(request, response) but what should the Action's execute() method then return instead of an ActionForward instance as I usually do?
Yeah, do you see foresee problems doing a mapping.findForward('xyz') after you have done a RequestDispatcher#forward(request, response) to another servlet?
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
Thanks, Pradeep. I believe that was exactly what I was looking for!
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
Originally posted by karthik Guru: Yeah, do you see foresee problems doing a mapping.findForward('xyz') after you have done a RequestDispatcher#forward(request, response) to another servlet?
That was my worry but I'm quite optimistic that Pradeep's link is the cure...
|
 |
 |
|
|
subject: Collaboration between Struts Actions and plain old Servlets
|
|
|