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

Submitting from "/" to "/"

Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
I have the following jsp codes:-

This form handles multiple user actions, and most of the actions are processed in "/" action class itself. However, I do have a button where when user clicks, it will submit to "/" to be processed...

So when user hits the submit button in the above "/", is it possible to submit the form to "/" and have the form fields mapped to the associated "/" actionform?

Currently, my workaround is to have a forward key in "/" pointing to "/", and it works. However, since it is doing forwarding, the URL still shows "/" instead of "/", but the content is generated by "/" action class.

Is there a way for the URL to show "/" when user submits from "/"?

I also tried creating a forward key in "/" pointing to "/", but have it as a redirect, but it seems like the request object doesn't have the "/" form fields information after getting redirected to "/".

Thanks much.
Scheepers de Bruin
Ranch Hand

Joined: Jul 19, 2005
Posts: 99
Try this:

<input type="button" value="The B form" on_click="document.forms[0].action='';document.forms[0].submit();">

where .forms[0] points to your first form on the document
you could also use "document.forms.myFormName.action"
And the on_click must not have an underscore (The website does not like javascript submitted)

We're doomed!!<br />Yay!!!<br />No that's bad Girr!!<br />Yay!!!
I agree. Here's the link:
subject: Submitting from "/" to "/"
It's not a secret anymore!