File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Don't need an ActionForm ! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Don Watch "Don New topic

Don't need an ActionForm !

Dave Hewitson

Joined: Jun 01, 2001
Posts: 27
I have a simple page, that just shows some stuff and allows the user to press a button and go back to the page they came from.
So, I don't need an ActionForm, but Struts forces me to have one if I want to use <html:form.......>
Now I can just use a normal <form...>, but, is there a recommended way of dealing with this scenario?
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
i'm not sure if there is a "recommended" way, but one thing you could do is use <html:button> and have it call some javascript. The javascript method called would direct the user to the appropriate action, whose path can be rendered using <html:rewrite>. I'm assuming of course that there is some reason you specifically want to use a button, and not an image button ( <html:image> ), or some kind of link ( <html:link> ).
Dave Hewitson

Joined: Jun 01, 2001
Posts: 27
I want to use a button only for consistency in the application.
I could just create an ActionForm with nothing in, but it seems odd to have to do this.
Or maybe, as you thought, have an image of a button with a link to the approriate action.
I agree. Here's the link:
subject: Don't need an ActionForm !
It's not a secret anymore!