Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Imange as submit button using struts tags

 
naresh kumar k
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I am trying to implement login application by image as submit button using struts tags like <html:image>.
but couldn't find the best way to do it.Is it necessary to write Image button details in action class



please help on this

thanks in advance
 
naresh kumar k
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys can any one please help me on this
I tried to use image as submit button in struts using html:image tag but it showing the following error

code:<html:image src="D:/Metaway/CSWorkSpace/CSWeb/WebContent/images/go.gif" property="Login" value="Login"></html:image>

Error:ERROR [org.apache.struts.actions.DispatchAction] Request[/coldStorageLogin] does not contain handler parameter named 'Login'. This may be caused by whitespace in the label text.


please help on this
regards
naresh k
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use the html:image tag with a property tag, the Struts library is going to look for getters/setters for that property:

The property name of this image tag. The parameter names for the request will appear as "property.x" and "property.y", the x and y representing the coordinates of the mouse click for the image. A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property="").

Struts Taglib Documentation
 
naresh kumar k
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Joe Ess,
thanks for the reply
I done what you suggested i defined getters and setters method in form class and made property="" but no use same error i am facing.
could you give me the code regarding jsp page for <html:image> tag and for action class if needed.

with regards
naresh kumar k
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic