Comments on: Struts best practices – white paper on JavaWorld https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/ Friends of Oracle and Java Sat, 25 Apr 2015 11:36:47 +0000 hourly 1 http://wordpress.org/?v=4.2 By: sandiego https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1737 Mon, 24 Oct 2005 18:15:59 +0000 /?p=400#comment-1737 how can I forward to an action class instead of an “unauthorized” page

]]>
By: sandiego https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1736 Mon, 24 Oct 2005 17:59:33 +0000 /?p=400#comment-1736 How can I call a action class instead of calling “unauthorized” page?

]]>
By: sandiego https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1735 Mon, 24 Oct 2005 17:57:36 +0000 /?p=400#comment-1735 In this case you are forwarding to an page which should be outside WEB-INF folder. Instead I would like to call an Action class. How can I do that?

]]>
By: Lucas https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1734 Tue, 15 Feb 2005 16:55:56 +0000 /?p=400#comment-1734 Leon,

Thanks a lot. That was what I was looking for. It is like you say: no hard-coded reference to a JSP – a reference that I did not like at all. This is much cleaner.

Lucas

]]>
By: Leon van Tegelen https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1733 Mon, 14 Feb 2005 21:17:13 +0000 /?p=400#comment-1733 The actual way to do it would be to forward to a global forward named “unauthorized” in the struts-config, like so
{
ForwardConfig fc = mapping.getModuleConfig().findForwardConfig(“unauthorized”);
request.getRequestDispatcher(fc.getPath()).forward(request,response);
}

No need for hardcoded errropage …

]]>
By: Jasper https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1732 Mon, 14 Feb 2005 16:26:36 +0000 /?p=400#comment-1732 Matthew: without lowering ourselfs to a framework-flamewar, could you elaborate on that?

]]>
By: Matthew Payne https://technology.amis.nl/2005/02/14/struts-best-practices-white-paper-on-javaworld/#comment-1731 Mon, 14 Feb 2005 15:54:47 +0000 /?p=400#comment-1731 Best practice #1:
Just switch to webwork and be done with it.

]]>