Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Imange as submit button using struts tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Imange as submit button using struts tags" Watch "Imange as submit button using struts tags" New topic
Author

Imange as submit button using struts tags

naresh kumar k
Ranch Hand

Joined: May 25, 2011
Posts: 30
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

Joined: May 25, 2011
Posts: 30
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

Joined: Oct 29, 2001
Posts: 8843
    
    7

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


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
naresh kumar k
Ranch Hand

Joined: May 25, 2011
Posts: 30
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Imange as submit button using struts tags
 
Similar Threads
hitting the enter on the keyBoard should default to "YES" button on the html/jsp page
Struts2 File Upload (Submit button)
Submit button as image
how i can have 2 Action for one Form with image as button?
Error 500: BeanUtils.populate