struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mark.l...@boxstuff.com>
Subject Re: [SOLVED] Default methodName for DispatchAction
Date Wed, 02 Jun 2004 20:26:19 GMT
I'm surprised using the parameter name didn't fix it..

All i can tell you is that it works for us with the stable release of  
1.1



On 2 Jun 2004, at 20:56, Kamholz, Keith (corp-staff) USX wrote:

> I actually think I'm going to be able to get around the problem.
> We're going to do new sort of browsing interface so I won't have to  
> use the
> form with multiple submits.
> Thanks for all the help though, the tips will come in handy I'm sure.
>
>
> - Keith
>
>
>
>
> -----Original Message-----
> From: Mark Shifman [mailto:mark.shifman@yale.edu]
> Sent: Wednesday, June 02, 2004 2:58 PM
> To: Struts Users Mailing List
> Subject: Re: [SOLVED] Default methodName for DispatchAction
>
>
> You should look at the source code for the version of DispatchAction  
> and
> LookupDispatchAction (available either from a download of src or the  
> cvs
> repository).  Older builds just threw an exception if LDA didn't find a
> parameter for method.  You can overide the execute() but you might just
> as well write your own action. DispatchAction works differently.  Newer
> builds of struts have modified the behavior of LDA.
>
> besides it is sort of fun to see how the things actually work.
>
> --mas
>
> Kamholz, Keith (corp-staff) USX wrote:
>
>> You know I was just thinking about doing "/foo.do?method" when I read  
>> your
>> post.  I stuck it in there, but that didn't work.
>> Then I tried "/foo.do?method=" and "/foo.do?method=label.modelBrowse"  
>> and
>> "/foo.do?method=model".  Now it executes the 'unspecified' method no  
>> matter
>> what I do, even if I click on one of the buttons...
>>
>>
>> - Keith
>>
>>
>> -----Original Message-----
>> From: Mark Lowe [mailto:mark.lowe@boxstuff.com]
>> Sent: Wednesday, June 02, 2004 11:21 AM
>> To: Struts Users Mailing List
>> Subject: Re: [SOLVED] Default methodName for DispatchAction
>>
>>
>> With the stable release of 1.1 you need to pass the parameter through
>>
>> usually
>>
>> /foo.do?method=save
>>
>> but to get the unspecified method running
>>
>> /foo.do?method
>>
>>
>> suck it n see.
>>
>>
>> On 2 Jun 2004, at 17:07, Kamholz, Keith (corp-staff) USX wrote:
>>
>>
>>
>>> Yeah, I have basically that code for the submit buttons.
>>> Isn't the 'unspecified' method of the LookupDispatchAction used to
>>> handle
>>> this issue though?  I thought that's exactly what it's purpose was,
>>> but the
>>> method is not getting executed as I expected it to.
>>> Very frustrating...
>>>
>>>
>>> - Keith
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Nicholas L Mohler [mailto:Nicholas_L_Mohler@raytheon.com]
>>> Sent: Wednesday, June 02, 2004 10:37 AM
>>> To: Struts Users Mailing List
>>> Subject: RE: [SOLVED] Default methodName for DispatchAction
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Most likely the "browseType" parameter is not defined in you page, so
>>> it is
>>> not submitted.
>>>
>>> If you're using the struts submit buttons, you probably have  
>>> something
>>> to
>>> the effect of:
>>> <html:submit property="browseType">
>>>    <beanMessage key="someKeyName"/>
>>> </html:submit>
>>>
>>> The effect of the button tag is that when it is clicked, the
>>> "browseType"
>>> parameter will be added into the request.  When the button is not
>>> clicked,
>>> the "browseType" parameter is not added into the request.  If I
>>> remember
>>> correctly, we had to implement a handler to listen for the enter key  
>>> to
>>> make sure that our parameter was added to the request.
>>>
>>> Nick
>>>
>>>
>>>
>>>
>>> |---------+---------------------------->
>>> |         |           "Kamholz, Keith  |
>>> |         |           (corp-staff) USX"|
>>> |         |           <kkamholz@moog.co|
>>> |         |           m>               |
>>> |         |                            |
>>> |         |           06/02/2004 10:00 |
>>> |         |           AM               |
>>> |         |           Please respond to|
>>> |         |           "Struts Users    |
>>> |         |           Mailing List"    |
>>> |         |                            |
>>> |---------+---------------------------->
>>>
>>>
>>>
>>>> -------------------------------------------------------------------- 
>>>> --
>>>> -----
>>>>
>>>>
>>> ---------------------------------------------------|
>>>  |
>>> |
>>>  |       To:       "'Struts Users Mailing List'"
>>> <user@struts.apache.org>
>>> |
>>>  |       cc:
>>> |
>>>  |       Subject:  RE: [SOLVED] Default methodName for DispatchAction
>>> |
>>>
>>>
>>>
>>>> -------------------------------------------------------------------- 
>>>> --
>>>> -----
>>>>
>>>>
>>> ---------------------------------------------------|
>>>
>>>
>>>
>>>
>>> Hmmmmm....
>>> It's not working for me.  I have a form with 4 different submit
>>> buttons.
>>> I'm trying to get it to execute the 'unspecified' method of my
>>> LookupDispatchAction when the user presses 'Enter' rather than
>>> clicking on
>>> a
>>> button.
>>>
>>> Right now I have:
>>>
>>> public ActionForward unspecified(ActionMapping mapping, ActionForm
>>> form,
>>>                                     HttpServletRequest request,
>>> HttpServletResponse
>>> response)
>>>                                     throws Exception
>>> {
>>>             System.out.println();
>>>             System.out.println("'Unspecified' Method executing...");
>>>             System.out.println();
>>>             return modelBrowse(mapping, form, request, response);
>>> }
>>>
>>> But when I press 'Enter' after filling in the form, my output doesn't
>>> get
>>> written to the console and I get an error that says:
>>> javax.servlet.ServletException: Request[/Browse] does not contain
>>> handler
>>> parameter named browseType
>>>
>>> Does anyone know what I'm doing wrong or how to fix this?  It works
>>> fine
>>> when I click on a button, but not when I press 'Enter'.
>>> Thanks!
>>>
>>>
>>>
>>> - Keith
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Kunal H. Parikh [mailto:kunalp@carsales.com.au]
>>> Sent: Tuesday, June 01, 2004 10:11 PM
>>> To: 'Struts Users Mailing List'
>>> Subject: RE: [SOLVED] Default methodName for DispatchAction
>>>
>>>
>>> Hi All!
>>>
>>> Just went through the source code.
>>>
>>> This problem can be attacked by overriding the method  
>>> unspecified(...)
>>>
>>> ===========
>>> public ActionForward unspecified(
>>>            ActionMapping mapping,
>>>            ActionForm form,
>>>            HttpServletRequest request,
>>>            HttpServletResponse response)
>>>            throws Exception {
>>> ===========
>>>
>>> Thanks,
>>>
>>> Kunal
>>> -----Original Message-----
>>> From: Kunal H. Parikh [mailto:kunalp@carsales.com.au]
>>> Sent: Wednesday, 2 June 2004 11:53
>>> To: 'Struts Users Mailing List'
>>> Subject: Default methodName for DispatchAction
>>>
>>> Hi All!
>>>
>>> I was wondering if it were possible to have a "default" method called
>>> when
>>> there is no parameter matched or the parameter is null.
>>>
>>>
>>> TIA,
>>>
>>> Kunal
>>>
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Mime
View raw message