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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to