• 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

Exceptions

 
Ranch Hand
Posts: 111
Eclipse IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello world

I have created my own exception handler

public class RolExceptionHandler extends org.apache.struts.action.ExceptionHandler{

public ActionForward execute( Exception ex, Exception exConfig, ActionMapping mapping,
ActionForm formInstance,
HttpServletRequest request,
HttpServletResponse response
)throws Exception{
String cmd = "success";
return mapping.findForward(cmd);



public class RolException extends Exception{

public RolException(String msg){
super(msg);
}

}

}

It's there any way to recover the msg into the jsp without passing it as a request paramenter

Many thans
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If at some point in your execute method, you will call super.execute(...), The Struts Exception handler will embed the original Exception message as parameter zero in the ActionMessage that is made available to the JSP. Example:

Message resources:

struts-config.xml

error.jsp

[ July 10, 2007: Message edited by: Merrill Higginson ]
 
Fernando Dominguez
Ranch Hand
Posts: 111
Eclipse IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
many thanks
reply
    Bookmark Topic Watch Topic
  • New Topic