File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Dynamic action in <html:form> tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic action in &lt;html:form&gt; tag" Watch "Dynamic action in &lt;html:form&gt; tag" New topic

Dynamic action in &lt;html:form&gt; tag

Carl Sampson

Joined: Apr 09, 2003
Posts: 22
Is it possible to have the action attribute of the <html:form> be dynamic? My issue is this. I'm using tiles for a page that has 4 common parts and 1 specific part. I want to reuse this page 7 times and swap out the specific part each time. My problem is that it contains a form which starts within the first common part. So, I would like to figure out a way to make the action attribute contain a dynamic target based on which page I'm on. Is that possible?
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Why not make the common parts into jsp includes?

A good workman is known by his tools.
Carl Sampson

Joined: Apr 09, 2003
Posts: 22
I tried putting the html:form tag in a tile, but it didn't like it when the starting tag and closing tag were in different tiles.

JSP includes and tiles are conceptually the same, right? What would be different about putting it in an include vs. a tile?
I agree. Here's the link:
subject: Dynamic action in &lt;html:form&gt; tag
It's not a secret anymore!