• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

problem in having multiple actions in a single jsp

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ....
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It's feeding time! Give me the food you were going to give to this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic