You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Axel Groß <ka...@iaeste.at> on 2004/07/01 10:39:55 UTC

Re: image submit and lookupDispatchAction - drives me struts

hi robert!

that's really nicely written code.
I'm not completely sure, why it does what i think it does though:
 you limit, which methods should get called in the struts-config, right?
(by specifying a list of the allowed buttonnames in the mapping)
 then you check if there is a [buttonname].x in the request which fits, right?
this indicates the button [buttonname] has been pressed so you dispatch to
lookup with [buttonname] as lookup key

so what is the intention for limiting the methods to the specified set?

if i change it to ignore the dynamic part of the button name it should work
for me; i should add some regexp lookup, maybe :)

thanks,
axel

On 2004-06-28 at 12:00:22 -0400, Robert Taylor wrote:
> This may help:
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=19925
> 
> robert
> 
> > -----Original Message-----
> > From: Axel Groß [mailto:kamikaze@iaeste.at]
> > Sent: Monday, June 28, 2004 11:52 AM
> > To: Struts Users Mailing List
> > Subject: Re: image submit and lookupDispatchAction - drives me struts
> >
> >
> > Hi Wendy thanks for the reply and the link!
> >
> > But unfortunately i can't see how to implement those solutions to my
> >  problem (which I didn't describe elaborate enought)
> >
> > My button names are of dynamic nature like
> >  DELETE_PROPERTY 'firstname'
> > (here firstname is the key of the property to delete)
> > so I can't use it for populating a bean. Or would using DynaBeans
> > help in this case? I don't know, in which class the html requests are
> > ~transformed to beans, so I'm not sure how it is handled.
> >
> > I rely would like to get rid of that horrible names.
> >
> > Javascript isn't feasible for this project.
> > I suppose html 4.0 buttons could solve the problem, I'll try that. But
> > relying on html 4.0 also doesn't sound too good. :(
> >
> > thanks again,
> > Axel
> >
> > On 2004-06-25 at 09:12:07 -0700, Wendy Smoak wrote:
> > > > From: Axel Groß [mailto:kamikaze@iaeste.at]
> > > > so the html:submit buttons do work, but neither of the
> > > > html:image buttons
> > > > pass the parameter on and i get a null reference for
> > > >  request.getParameter(parameter);
> > > > (with parameter.equals("action"))
> > > > the resulting error message is:
> > > >  Request[/action/lookupDispatch] does not contain handler
> > > > parameter named action
> > > > anybody knows what could help?
> > >
> > > http://www.google.com/search?q=struts+image+button
> > >
> > > First hit:
> > > http://www.jguru.com/faq/view.jsp?EID=893423
> > > which discusses the use of the ImageButtonBean class.
> > >
> > > Or, my preferred solution is a bit of onClick JavaScript to set the form property and submit the form.  This only works
> > in situations where where you can require that JavaScript be enabled.
> > >
> > > --
> > > Wendy Smoak
> > > Application Systems Analyst, Sr.
> > > ASU IA Information Resources Management
> > >
> > > ---------------------------------------------------------------------
> > > 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
> 
> 

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


RE: image submit and lookupDispatchAction - drives me struts

Posted by Robert Taylor <rt...@newatlanta.com>.
Well, yes, you could say:

Look for anything in the request that matches a pattern.
Then it has to iterate through all request parameters and execute
the matching algorithm on each parameter.

By defining a list of names to expect, then I'm performing a hash key
lookup on each element in a very small list.


robert

> -----Original Message-----
> From: Axel Groß [mailto:kamikaze@iaeste.at]
> Sent: Thursday, July 01, 2004 4:40 AM
> To: Struts Users Mailing List
> Subject: Re: image submit and lookupDispatchAction - drives me struts
>
>
> hi robert!
>
> that's really nicely written code.
> I'm not completely sure, why it does what i think it does though:
>  you limit, which methods should get called in the struts-config, right?
> (by specifying a list of the allowed buttonnames in the mapping)
>  then you check if there is a [buttonname].x in the request which fits, right?
> this indicates the button [buttonname] has been pressed so you dispatch to
> lookup with [buttonname] as lookup key
>
> so what is the intention for limiting the methods to the specified set?
>
> if i change it to ignore the dynamic part of the button name it should work
> for me; i should add some regexp lookup, maybe :)
>
> thanks,
> axel
>
> On 2004-06-28 at 12:00:22 -0400, Robert Taylor wrote:
> > This may help:
> >
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=19925
> >
> > robert
> >
> > > -----Original Message-----
> > > From: Axel Groß [mailto:kamikaze@iaeste.at]
> > > Sent: Monday, June 28, 2004 11:52 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: image submit and lookupDispatchAction - drives me struts
> > >
> > >
> > > Hi Wendy thanks for the reply and the link!
> > >
> > > But unfortunately i can't see how to implement those solutions to my
> > >  problem (which I didn't describe elaborate enought)
> > >
> > > My button names are of dynamic nature like
> > >  DELETE_PROPERTY 'firstname'
> > > (here firstname is the key of the property to delete)
> > > so I can't use it for populating a bean. Or would using DynaBeans
> > > help in this case? I don't know, in which class the html requests are
> > > ~transformed to beans, so I'm not sure how it is handled.
> > >
> > > I rely would like to get rid of that horrible names.
> > >
> > > Javascript isn't feasible for this project.
> > > I suppose html 4.0 buttons could solve the problem, I'll try that. But
> > > relying on html 4.0 also doesn't sound too good. :(
> > >
> > > thanks again,
> > > Axel
> > >
> > > On 2004-06-25 at 09:12:07 -0700, Wendy Smoak wrote:
> > > > > From: Axel Groß [mailto:kamikaze@iaeste.at]
> > > > > so the html:submit buttons do work, but neither of the
> > > > > html:image buttons
> > > > > pass the parameter on and i get a null reference for
> > > > >  request.getParameter(parameter);
> > > > > (with parameter.equals("action"))
> > > > > the resulting error message is:
> > > > >  Request[/action/lookupDispatch] does not contain handler
> > > > > parameter named action
> > > > > anybody knows what could help?
> > > >
> > > > http://www.google.com/search?q=struts+image+button
> > > >
> > > > First hit:
> > > > http://www.jguru.com/faq/view.jsp?EID=893423
> > > > which discusses the use of the ImageButtonBean class.
> > > >
> > > > Or, my preferred solution is a bit of onClick JavaScript to set the form property and submit the form.  This only works
> > > in situations where where you can require that JavaScript be enabled.
> > > >
> > > > --
> > > > Wendy Smoak
> > > > Application Systems Analyst, Sr.
> > > > ASU IA Information Resources Management
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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