I'm getting the same result with Netscape 4.7 and IE 5.5 -- so if the
browser react to the input image, like the submit button, but do not
pass the value the same way, then the only alternative seems to be to
examine the x:y parameters, and use those to determine which button was
pressed. 

If that's the case, I'll work a note into the Developer's Guide. 

Zhengxi Ruan wrote:
> 
> it is not a bug of Struts, but the browser's.
> 
> Jesse
> 
> -----Original Message-----
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 13, 2001 7:52 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Fwd: FW: REPOST: How to code and use the html:image tag?]
> 
> You're right. This doesn't seem to be working. I'd report it as a bug.
> 
> < http://nagoya.apache.org/bugzilla/ >
> 
> [EMAIL PROTECTED] wrote:
> >
> >  Ted,
> >         I tried this with no success. I put two html:image tags into my
> > login.jsp
> >
> > <tr><td></td><td><html:image page="/images/lanikai.jpg" property =
> > "login" value="lanikai" /><td></tr>
> > <tr><td></td><td><html:image page="/images/larry.jpg" property = "login"
> > value="larry" /><td></tr>
> >
> > In the perform method of LoginAction.java I traverse the Enumeration
> > returned by request.getParameters() looking for a parameter named login.
> > It's not there. :-(
> >
> > Here's the code:
> >
> >        java.util.Enumeration enum = request.getParameterNames();
> >         while( enum.hasMoreElements() ){
> >             String str = (String) enum.nextElement();
> >             System.out.println( str + " => " + request.getParameter( str
> > ) );
> >
> >         }
> > and the output:
> >
> > course => pebblebeach
> > login.y => 147
> > login.x => 129
> >
> > I have a html:select named course set to pebblebeach. I DO get the
> > mouseclick x and y values. So, I'm seeing something from my login
> > control.
> >
> > I don't see what I'm doing wrong.
> >
> > thanks
> >
> > john ware
> >
> > -----Original Message-----
> > From: Ted Husted [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 13, 2001 12:59 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: REPOST: How to code and use the html:image tag?
> >
> > The property and value for the button is passed as a parameter
> > (property=value), that you can retrieve from the request context.
> >
> > A typical approach would be to give each button the same property but
> > different values, like
> >
> > <html:image page="/images/login.gif" alt="Login" property="login"
> > value="havePassword" />
> > <html:image page="/images/forgotpassword.gif" alt="Forgot Password"
> > property="login" value="forgotPassword" />
> >
> > Then in the action method, you would use a pattern like
> >
> > string loginType = request.getParameter("login") ;
> > if loginType.equals(""forgotPassword") { forward to forgotPassword page
> > }
> > if loginType.equals("havePassword") { validate password  }
> >
> > "Suriyanarayanan, Senthil Kumar" wrote:
> > > What methods should I code inside my LoginForm corresponding to those
> two
> > > buttons? How to code the properties (loginButton, forgotPasswordButton).
> > I'm
> > > more concerned about whether a particular button is clicked rather then
> > > their co-ordinates.
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/

Reply via email to