Hi all,

 

First, this is not a Struts 2 question..

And thanks to anyone who reads below.

 

I was wondering how other's handled this problem with the
org.apache.struts.actions.DispatchAction in Struts 1.3.9.

 

I have an action that calls a data service that is to be presented to the
user in numerous formats by using DispatchAction.  

*       View
*       XLS
*       PDF

 

As they all utilizes a common data service, I thought that this would be an
excellent candidate for DispatchAction to centralize the call into one
action.

Say the parameter used was named "export", so my action mapping looks like,

 

<action path="/UserOrders" type="com.nuhorizons.web.shop.actions.UserOrders"
scope="request" parameter="export">

      <forward name="success" path="/WEB-INF/jsps/pages/userOrders.jsp"/>

</action>

 

UserOrders extends DispatchAction and all this is working fine.

 

I implement the following methods.

 

public ActionForward unspecified(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception

 

public ActionForward excel(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception

 

public ActionForward pdf(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception

 

All is well, until...

http://localhost:8080/myapp/UserOrders.do?export=unnamedmethod

 

 

When DispatchAction attempts to find the unnamedmethod, it throws a
NoSuchMethodException prior to calling any method.  Our app is configured to
show a 500 page, and I know that I could use the <global-exceptions> and
create an exception handler but the NoSuchMethodException is such a generic
exception.  Wrapping the exception is not really an option as it is thrown
by DispatchAction. 

 

Has anyone thought of a good way for DispatchAction to handle an unnamed
method??  

 

Ed

The information contained in this e-mail is legally privileged and confidential 
information intended only for use by the  individual or entity named above.  If 
the reader of this e-mail is not the intended recipient, you are hereby 
notified that any dissemination or distribution hereof is prohibited.  If you 
have received this e-mail in error, please delete the material from your 
computer and immediately notify us at   631-396-5000.  Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to