• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Changing the target attribute before making a forward

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic