You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/03/02 18:30:43 UTC

DO NOT REPLY [Bug 33813] New: - New DispatchAction where 'parameter' determines the method instead of the name of the parameter in the request.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33813>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33813

           Summary: New DispatchAction where 'parameter' determines the
                    method instead of the name of the parameter in the
                    request.
           Product: Struts
           Version: Unknown
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Controller
        AssignedTo: dev@struts.apache.org
        ReportedBy: leite@mail.com


I have a suggestion: add a new DispatchAction, or change the existing, to allow:

We've implemented a similar DispatchAction, wich uses the 'parameter' attribute 
of the action mapping to determine the method that should be executed, 
different from the existing DispathAction, where the 'parameter' attribute 
determine the name of the parameter in the request that indicate the method.


Now:
----------------
  <action
      path="/path/of/mapping"
      type="package.of.the.MyAction"
      name="myForm"
      scope="request"
      parameter="method"
  >
  </action

---

public class MyAction extends DispatchAction {

    public ActionForward open(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) throws Exception {
	// code here
    }
}

--

In the request, there is a parameter named 'method' with the value 'open'. The 
value of this parameter determines the method that will be executed in the 
Action, wich is 'open()'.
----------------


Suggestion:
----------------
  <action
      path="/path/of/mapping"
      type="package.of.the.MyAction"
      name="myForm"
      scope="request"
      parameter="open"
  >
  </action

---

public class MyAction extends NewDispatchAction {

    public ActionForward open(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) throws Exception {
	// code here
    }
}

--

There is no need of a parameter in the request, since the mapping itself 
determines the method that should be called.
----------------

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org