File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing the target attribute before making a forward

 
Andres Pineda
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I need to change the target attribute of a form element (HTML) before calling the forward() method of a RequestDispatcher object from a servlet Admin in a MVC design pattern, That's because when I got a database error, I need to forward to an error page in a diferent frame from that the original form target specify. May be that's impossible but any idea or alternative solution would be thanks.
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm not sure i understood what you wanna do, but in case i did... if you get an exception thrown you wanna redirect your page to some kind of "error" page. you can do it with your web.xml file (deployment descriptor). use this tag:
<error-page>
<exception-type>SomeKindOfException</exception-type>
<location>/iwrotebadcode.jsp</location>
</error-page>
try it.
 
Andres Pineda
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you, I've solved my problem using an Error Applet that shows another page in a new window if an error ocurrs in the server side.
Thank you again
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic