aspose file tools*
The moose likes Struts and the fly likes problem in having multiple actions in a single jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in having multiple actions in a single jsp" Watch "problem in having multiple actions in a single jsp" New topic
Author

problem in having multiple actions in a single jsp

Ranjith Koppu
Greenhorn

Joined: Dec 04, 2006
Posts: 7
Hi javaranchers
I am facing the following problem...

I have a jsp page by name index.jsp and it has the one <html:form> tag with action as login.do that is <html:form action="/login">
and I have 2 <html:link> tags in the same form with different actions

say <html:link action="/activate">
<html:link action="/forgotpassword">

Now the problem is if I try to submit the form I am getting the exception as
javax.servlet.jsp.JspException: Cannot create rewrite URL: java.net.MalformedURLException: You must specify exactly one of "forward", "href", "page" or "action"

Is this exception raising just because I have multiple actions in the same form or for something else..
If that is the reason can I use a javascript function to change the action of the form dynamically on click of the link and then submit the form
Will this solve my problemm

I can't try this in my code as I dont have the testing server up right now.
please give me a solution to this problem as soon as possible.
Milan Jagatiya
Ranch Hand

Joined: Jan 01, 2007
Posts: 164
Originally posted by Ranju Kumar:
<html:link action="/activate">
<html:link action="/forgotpassword">

Now the problem is if I try to submit the form I am getting the exception as
javax.servlet.jsp.JspException: Cannot create rewrite URL: java.net.MalformedURLException: You must specify exactly one of "forward", "href", "page" or "action"

Is this exception raising just because I have multiple actions in the same form or for something else..


well, you can have more than one html:link in your form tag....seems syntax problem i think...can you post your forms code ....


Milan.<br />I can because I think I can...
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Milan is correct in that having multiple html:link tags should not cause issues and that it must be something else. I wonder if you are actually getting this error when the server tries to process the jsp specified by your forward. Are you using the html:rewrite tag? To me it looks like you have a page with a invalid html:rewrite tag.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in having multiple actions in a single jsp