You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Pablo L. Crivaro" <pc...@pangea.com.ar> on 2003/01/28 20:56:26 UTC

hi
i want access the error list written by the <html:errors/> tag usign java,
not the tag (i wanna submit exceptions by mail automatically). how is that?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re:

Posted by Jakarta <ja...@interlap.com.ar>.
Thanks! Looks interesting. I've not tested it yet. BUT i'm using the
<exception> option in the struts-config.xml to show via <html:errors/> some
relevant exceptions to the user (and mail them to me --as bugs?--). so who
will catch the exceptions? j4l, the strut's ExceptionHandler or both?

spying inside the strut's sources i've found the ActionErrors are stored as
context's attributes. ergo inside the jsp source i can retrieve them this
way

ActionErrors e = (ActionErrors)
request.getAttribute(ActionErrors.GLOBAL_ERROR);

and mail them with a JavaMail session.
but it'll be good to trap all other exceptions. i'll test it

regards

----- Original Message -----
From: "Jon Wingfield" <jo...@mkodo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, January 28, 2003 6:15 PM
Subject: Re: <html:errors/>


> Are you using log4j? If you are then chack out the
> org.apache.log4j.net.SMPTAppender. It sends a mail each time a message
> of the required severity is logged.
>
>
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.h
tml
>
> example of log4j.properies portion for this appender:
>
> log4j.rootCategory=info, mail
>
> log4j.appender.mail=org.apache.log4j.net.SMTPAppender
> log4j.appender.mail.To=sysadmin@your.domain.com
> log4j.appender.mail.From=your.webapp@your.domain.com
> log4j.appender.mail.SMTPHost=@MAIL_HOST@
> log4j.appender.mail.Threshold=ERROR
> log4j.appender.mail.BufferSize=1
> log4j.appender.mail.Subject=Application Error
>
>
> Pablo L. Crivaro wrote:
> > hi
> > i want access the error list written by the <html:errors/> tag usign
java,
> > not the tag (i wanna submit exceptions by mail automatically). how is
that?
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re:

Posted by Jon Wingfield <jo...@mkodo.com>.
Are you using log4j? If you are then chack out the 
org.apache.log4j.net.SMPTAppender. It sends a mail each time a message 
of the required severity is logged.

http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html

example of log4j.properies portion for this appender:

log4j.rootCategory=info, mail

log4j.appender.mail=org.apache.log4j.net.SMTPAppender
log4j.appender.mail.To=sysadmin@your.domain.com
log4j.appender.mail.From=your.webapp@your.domain.com
log4j.appender.mail.SMTPHost=@MAIL_HOST@
log4j.appender.mail.Threshold=ERROR
log4j.appender.mail.BufferSize=1
log4j.appender.mail.Subject=Application Error


Pablo L. Crivaro wrote:
> hi
> i want access the error list written by the <html:errors/> tag usign java,
> not the tag (i wanna submit exceptions by mail automatically). how is that?
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>