Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in having multiple actions in a single jsp

 
Ranjith Koppu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ....
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic