You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Frances Aleah Z. de Guzman" <ad...@ingenium.com.ph> on 2003/06/25 22:31:19 UTC

LookupDispatchAction question part2

i had posted a question i think 3 days ago about submitting a form to a 
LookupDispatchAction without hitting any button and still having a default 
value of the parameter handler. someone advised me (im sorry i forgot your 
name) that i should have a hidden property of my parameter name, so that 
eventhough i hit the enter button the submitted form will go to the method of 
the action corresponding to the default value of the parameter i specified. 
and it worked! but i have the same problem again with a little twist....in my 
jsp i have a display of collection in a tabular form, and each record has a 
link going to an lookupdispatchaction that will edit its contents. i used 
<html:link action="/holiday.do" paramId="id" paramName="holiday" 
paramProperty="holidayId"/>, but everytime i click this link im having the 
same exception as before "Request[/holiday] does not contain handler 
parameter named action". i put a hidden property of action eventhough i know 
that wont work coz link doesnt submit the form. how will i solve this?
-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



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


Re: LookupDispatchAction question part2

Posted by "Frances Aleah Z. de Guzman" <ad...@ingenium.com.ph>.
thanks jason, i double checked my application.properties and i found out that 
the value of my action should be "Edit" with the capital "E" but what im 
putting a while ago is "e"....hehehe....my mistake! thanks again.

On Thursday 26 June 2003 06:58 pm, Jason Lea wrote:
> Hi Frances,
>
> Frances Aleah Z. de Guzman wrote:
> > im sorry but im having the same exception
>
> What does your <html:link> tag look like?
> What was the HTML output it produced?
> What do you have in your getKeyMethodMap()?
> What are the matching entries in your application.properties file?
>
> If you post those things I might be able to help better...
>
> --jason
>
> > On Thursday 26 June 2003 05:01 pm, Jason Lea wrote:
> >>Frances Aleah Z. de Guzman wrote:
> >>>i had posted a question i think 3 days ago about submitting a form to a
> >>>LookupDispatchAction without hitting any button and still having a
> >>>default value of the parameter handler. someone advised me (im sorry i
> >>>forgot your name) that i should have a hidden property of my parameter
> >>>name, so that eventhough i hit the enter button the submitted form will
> >>>go to the method of the action corresponding to the default value of the
> >>>parameter i specified. and it worked! but i have the same problem again
> >>>with a little twist....in my jsp i have a display of collection in a
> >>>tabular form, and each record has a link going to an
> >>> lookupdispatchaction that will edit its contents. i used <html:link
> >>> action="/holiday.do" paramId="id" paramName="holiday"
> >>> paramProperty="holidayId"/>, but everytime i click this link im having
> >>> the same exception as before "Request[/holiday] does not contain
> >>> handler parameter named action". i put a hidden property of action
> >>> eventhough i know that wont work coz link doesnt submit the form. how
> >>> will i solve this?
> >>
> >>You should be able to add the dispatch name to the action in the link
> >> tag:
> >>
> >><html:link action="/holiday.do?action=edit" paramId="id"
> >>paramName="holiday" paramProperty="holidayId"/>
> >>
> >>I don't think you need the '.do' on the action either (the tag can match
> >>the correct action without it) so this should work:
> >>
> >><html:link action="/holiday?action=edit" paramId="id"
> >>paramName="holiday" paramProperty="holidayId"/>
> >>
> >>Of course you might have trouble with this sort of link because the
> >>LookupDispatchAction will try to match the action parameter's value with
> >>a localised key.  I define two keys for each method eg
> >>
> >>protected Map getKeyMethodMap() {
> >>     Map map = new HashMap();
> >>     map.put("global.action.internal.list", "list");
> >>     map.put("global.action.internal.edit", "edit");
> >>     map.put("button.list", "list");
> >>     map.put("button.edit", "edit");
> >>     return map;
> >>}
> >>
> >>
> >>The global.action.internal.* keys are only defined in my
> >>application.properties file so I can create standard links like the one
> >>above.  The button.* keys are defined application.properties and also
> >>the other locales (eg application_ja.properties) so my buttons can show
> >>the localised name and still call the correct method.

-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



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


Re: LookupDispatchAction question part2

Posted by Jason Lea <ja...@kumachan.net.nz>.
Hi Frances,

Frances Aleah Z. de Guzman wrote:
> im sorry but im having the same exception

What does your <html:link> tag look like?
What was the HTML output it produced?
What do you have in your getKeyMethodMap()?
What are the matching entries in your application.properties file?

If you post those things I might be able to help better...

--jason

> 
> On Thursday 26 June 2003 05:01 pm, Jason Lea wrote:
> 
>>Frances Aleah Z. de Guzman wrote:
>>
>>>i had posted a question i think 3 days ago about submitting a form to a
>>>LookupDispatchAction without hitting any button and still having a
>>>default value of the parameter handler. someone advised me (im sorry i
>>>forgot your name) that i should have a hidden property of my parameter
>>>name, so that eventhough i hit the enter button the submitted form will
>>>go to the method of the action corresponding to the default value of the
>>>parameter i specified. and it worked! but i have the same problem again
>>>with a little twist....in my jsp i have a display of collection in a
>>>tabular form, and each record has a link going to an lookupdispatchaction
>>>that will edit its contents. i used <html:link action="/holiday.do"
>>>paramId="id" paramName="holiday" paramProperty="holidayId"/>, but
>>>everytime i click this link im having the same exception as before
>>>"Request[/holiday] does not contain handler parameter named action". i
>>>put a hidden property of action eventhough i know that wont work coz link
>>>doesnt submit the form. how will i solve this?
>>
>>You should be able to add the dispatch name to the action in the link tag:
>>
>><html:link action="/holiday.do?action=edit" paramId="id"
>>paramName="holiday" paramProperty="holidayId"/>
>>
>>I don't think you need the '.do' on the action either (the tag can match
>>the correct action without it) so this should work:
>>
>><html:link action="/holiday?action=edit" paramId="id"
>>paramName="holiday" paramProperty="holidayId"/>
>>
>>Of course you might have trouble with this sort of link because the
>>LookupDispatchAction will try to match the action parameter's value with
>>a localised key.  I define two keys for each method eg
>>
>>protected Map getKeyMethodMap() {
>>     Map map = new HashMap();
>>     map.put("global.action.internal.list", "list");
>>     map.put("global.action.internal.edit", "edit");
>>     map.put("button.list", "list");
>>     map.put("button.edit", "edit");
>>     return map;
>>}
>>
>>
>>The global.action.internal.* keys are only defined in my
>>application.properties file so I can create standard links like the one
>>above.  The button.* keys are defined application.properties and also
>>the other locales (eg application_ja.properties) so my buttons can show
>>the localised name and still call the correct method.
> 
> 


-- 
Jason Lea


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


Re: LookupDispatchAction question part2

Posted by "Frances Aleah Z. de Guzman" <ad...@ingenium.com.ph>.
im sorry but im having the same exception

On Thursday 26 June 2003 05:01 pm, Jason Lea wrote:
> Frances Aleah Z. de Guzman wrote:
> > i had posted a question i think 3 days ago about submitting a form to a
> > LookupDispatchAction without hitting any button and still having a
> > default value of the parameter handler. someone advised me (im sorry i
> > forgot your name) that i should have a hidden property of my parameter
> > name, so that eventhough i hit the enter button the submitted form will
> > go to the method of the action corresponding to the default value of the
> > parameter i specified. and it worked! but i have the same problem again
> > with a little twist....in my jsp i have a display of collection in a
> > tabular form, and each record has a link going to an lookupdispatchaction
> > that will edit its contents. i used <html:link action="/holiday.do"
> > paramId="id" paramName="holiday" paramProperty="holidayId"/>, but
> > everytime i click this link im having the same exception as before
> > "Request[/holiday] does not contain handler parameter named action". i
> > put a hidden property of action eventhough i know that wont work coz link
> > doesnt submit the form. how will i solve this?
>
> You should be able to add the dispatch name to the action in the link tag:
>
> <html:link action="/holiday.do?action=edit" paramId="id"
> paramName="holiday" paramProperty="holidayId"/>
>
> I don't think you need the '.do' on the action either (the tag can match
> the correct action without it) so this should work:
>
> <html:link action="/holiday?action=edit" paramId="id"
> paramName="holiday" paramProperty="holidayId"/>
>
> Of course you might have trouble with this sort of link because the
> LookupDispatchAction will try to match the action parameter's value with
> a localised key.  I define two keys for each method eg
>
> protected Map getKeyMethodMap() {
>      Map map = new HashMap();
>      map.put("global.action.internal.list", "list");
>      map.put("global.action.internal.edit", "edit");
>      map.put("button.list", "list");
>      map.put("button.edit", "edit");
>      return map;
> }
>
>
> The global.action.internal.* keys are only defined in my
> application.properties file so I can create standard links like the one
> above.  The button.* keys are defined application.properties and also
> the other locales (eg application_ja.properties) so my buttons can show
> the localised name and still call the correct method.

-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



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


Re: LookupDispatchAction question part2

Posted by Jason Lea <ja...@kumachan.net.nz>.
Frances Aleah Z. de Guzman wrote:
> i had posted a question i think 3 days ago about submitting a form to a 
> LookupDispatchAction without hitting any button and still having a default 
> value of the parameter handler. someone advised me (im sorry i forgot your 
> name) that i should have a hidden property of my parameter name, so that 
> eventhough i hit the enter button the submitted form will go to the method of 
> the action corresponding to the default value of the parameter i specified. 
> and it worked! but i have the same problem again with a little twist....in my 
> jsp i have a display of collection in a tabular form, and each record has a 
> link going to an lookupdispatchaction that will edit its contents. i used 
> <html:link action="/holiday.do" paramId="id" paramName="holiday" 
> paramProperty="holidayId"/>, but everytime i click this link im having the 
> same exception as before "Request[/holiday] does not contain handler 
> parameter named action". i put a hidden property of action eventhough i know 
> that wont work coz link doesnt submit the form. how will i solve this?

You should be able to add the dispatch name to the action in the link tag:

<html:link action="/holiday.do?action=edit" paramId="id" 
paramName="holiday" paramProperty="holidayId"/>

I don't think you need the '.do' on the action either (the tag can match 
the correct action without it) so this should work:

<html:link action="/holiday?action=edit" paramId="id" 
paramName="holiday" paramProperty="holidayId"/>

Of course you might have trouble with this sort of link because the 
LookupDispatchAction will try to match the action parameter's value with 
a localised key.  I define two keys for each method eg

protected Map getKeyMethodMap() {
     Map map = new HashMap();
     map.put("global.action.internal.list", "list");
     map.put("global.action.internal.edit", "edit");
     map.put("button.list", "list");
     map.put("button.edit", "edit");
     return map;
}


The global.action.internal.* keys are only defined in my 
application.properties file so I can create standard links like the one 
above.  The button.* keys are defined application.properties and also 
the other locales (eg application_ja.properties) so my buttons can show 
the localised name and still call the correct method.

-- 
Jason Lea


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