UPDATE:
I just tried doing what I thought would be ugly:

protected ActionForward unspecified(

ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception

{

return showList(mapping, form, request, response);

}


And it didn't work either, it threw the same exception, EVEN THOUGH the forward that returns from "showList" is actually pointing to a JSP page (not another Action or LDA like was my original problem). To be honest I'm not even entirely sure that my unspecified method got called, because the exception I get is EXACTLY the same... I'm using Struts 1.1, and I thought I saw somewhere in a longer thread from March I think that this didn't work in 1.1 but works in 1.2 (nightly build)?


Riyad Kalla wrote:

Hello,
I have a situation where my LookupDispatchAction (LDA) has all my functionality for a particular entity defined in it (lets say "Product"). So that includes adding, removing, listing, editing and changing their order (moving them visually up/down in the table they are listed in).


So far everything works fine, however I am running into a problem when I have my LDA returning a forward BACK to itself. This situation arises when someone changes the order of a product (maybe they move it down), so what happens is the "Down" button is pressed, execution goes to the "moveDown" method in the LDA. At the end of that method, a forward is returned that actually points to the same LDA, but is suppose to call the "showList" method (different path). This is done because after the order of the products is changed, you need to refresh the page with the list of products again so the user sees the changed ordering.

However, as you can imagine, I get the following exception after returning the forward:

javax.servlet.ServletException: Request[/forward/product/showList] does not contain handler parameter named method
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:199)


org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


I've tried (at the end of the 'moveDown' method) to manually set a parameter (get an IllegalStateException because 'Config is Frozen') and tried to add a request attribute all by the name I have defined for the parameter (it happens to be 'method') and none of it worked.


So to recap if this isn't clear so far, going into my LDA to change the ordering is fine because its from a JSP link where a value for 'parameter' is defined, so the LDA knows which method to call. However by the end of the "moveDown" method, where I need to send execution over to the "showList" method, I have no way to define a parameter value, so when the forward is returned, and execution comes BACK to the LDA, it has no parameter value (hence the exception). I've looked into using the "unspecified" method, but it SEEMS to me like that has the exact same problem... if no parameter is specified, I STILL want to forward to the showList method in the LDA, but I still won't be able to set the parameter, and it seems ugly to do a:

protected ActionForward unspecified(

ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception

{

return showList();

}


Does anyone know how I would be able to forward from one method in an LDA to another method in the same LDA (or any other LDA for that matter...)? My entire site is a 1:1 mapping for actions and JSPs, so users never actually see ".jsp" in their address bar, its always ".do", so being able to go between LDAs is pretty important to me ;)


Thank you for any help you can provide!
-Riyad

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


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



Reply via email to