aspose file tools*
The moose likes Struts and the fly likes html form +struts submit values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html form +struts submit values" Watch "html form +struts submit values" New topic
Author

html form +struts submit values

A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
Hi all I am working with a html form that has to have several submit values in order to determine the action that is to be taken. The problem that I am encountering is that when I get into my action class for that page I am using the property and value portions of the submit tag to determine the right action. This would be fine if I could still specify the text that is displayed on the screen, which unfortunately is being taken from the value portion of the submit. I can see this is a horrible thing to have, as any change to the presentation would also mean a required change in the code. The only solution I have come up with to this point is to give each submit button a different property and then check which one is not null. I am fairly certain there are better solutions, and I am not even sure if what I have proposed will work.

Any thoughts/advice would be appreciated.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try using LookupDispatchAction, and use the ApplicationResources file for the value of your submit buttons. By doing this, you can change the way your submit buttons are displayed without changing the logic in your Action class.

For more information on how to use LookupDispatchAction, seethis link.


Merrill
Consultant, Sima Solutions
A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
Thanks for the link. I was looking at that and didn't understand it and continued to work until I had something that at least made sure I could do what I wanted. I think that is going to fall into the beautification process that will happen in the very near future. There are other components that I want to ensure will at least work before I come back to making it work perfectly. I hope you don't mind if I bring this topic back up in the future.

thanks again for the link, it's nice to know that I was looking at something that was on the right track (even if I didn't use it off the hop ).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html form +struts submit values