You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Severin <pp...@architekt.ro> on 2001/07/18 15:53:01 UTC

Subclass ActionServlet to behave as central controller

Hi ppl,

    Would it be possible to subclass the ActionServlet to add behaviour
needed for it to behave as central controller so it could handle all the
requests coming to the web application, not only the action execution
requests ? In the subclassed ActionServlet I want to be able to add some
logic which will determine where the request should be forwarded in case
where isn't any action to be processed by ActionServlet. For example a
request for /example/some_page.do could be forwarded to /some_page.jsp
OR /WEB-INF/jsp/some_page.jsp. I don't want to add mappings in
struts-config.xml for each page I have in the application.

Peter.



Re: Subclass ActionServlet to behave as central controller

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 18 Jul 2001, Oleg V Alexeev wrote:

> Hello Peter,
> 
> Wednesday, July 18, 2001, 5:53:01 PM, you wrote:
> 
> PS> Hi ppl,
> 
> PS>     Would it be possible to subclass the ActionServlet to add behaviour
> PS> needed for it to behave as central controller so it could handle all the
> PS> requests coming to the web application, not only the action execution
> PS> requests ? In the subclassed ActionServlet I want to be able to add some
> PS> logic which will determine where the request should be forwarded in case
> PS> where isn't any action to be processed by ActionServlet. For example a
> PS> request for /example/some_page.do could be forwarded to /some_page.jsp
> PS> OR /WEB-INF/jsp/some_page.jsp. I don't want to add mappings in
> PS> struts-config.xml for each page I have in the application.
> 
> Yes, of course. You can extend ActionServlet and append your own logic
> to support additional behaviors.
> 
> -- 
> Best regards,
>  Oleg                            mailto:gonza@penza.net
> 
> 
> 


Re: Subclass ActionServlet to behave as central controller

Posted by Oleg V Alexeev <go...@penza.net>.
Hello Peter,

Wednesday, July 18, 2001, 5:53:01 PM, you wrote:

PS> Hi ppl,

PS>     Would it be possible to subclass the ActionServlet to add behaviour
PS> needed for it to behave as central controller so it could handle all the
PS> requests coming to the web application, not only the action execution
PS> requests ? In the subclassed ActionServlet I want to be able to add some
PS> logic which will determine where the request should be forwarded in case
PS> where isn't any action to be processed by ActionServlet. For example a
PS> request for /example/some_page.do could be forwarded to /some_page.jsp
PS> OR /WEB-INF/jsp/some_page.jsp. I don't want to add mappings in
PS> struts-config.xml for each page I have in the application.

Yes, of course. You can extend ActionServlet and append your own logic
to support additional behaviors.

-- 
Best regards,
 Oleg                            mailto:gonza@penza.net