Where are Struts messages found?

2001-04-11 Thread James Howe

I'm working with Struts and I'm trying to build an error page for my JSP 
application.   In looking at the Struts tag code I see statements which 
look like this:

throw new JspException(messages.getMessage("getter.bean", beanName)));  

which looks like it should be populating the exception with some useful 
information.  However, when I execute this code in a debugger, the message 
assigned to the Exception is null because there is no message with the name 
"getter.bean".  Where would I find definitions for messages such as 
"getter.bean", "optionsTag.iterator", etc?




Re: Where are Struts messages found?

2001-04-11 Thread James Howe

Nevermind.  I found them in places like 
org/apache/struts/util/LocalStrings.properties.  I'm running Tomcat/Struts 
from within VisualAge and I hadn't properly imported the Struts resources 
and I was missing these properties files.

At 11:33 AM 4/11/2001 -0400, you wrote:
I'm working with Struts and I'm trying to build an error page for my JSP 
application.   In looking at the Struts tag code I see statements which 
look like this:

throw new JspException(messages.getMessage("getter.bean", beanName)));

which looks like it should be populating the exception with some useful 
information.  However, when I execute this code in a debugger, the message 
assigned to the Exception is null because there is no message with the 
name "getter.bean".  Where would I find definitions for messages such as 
"getter.bean", "optionsTag.iterator", etc?

James W. Howe   mailto:[EMAIL PROTECTED]
Allen Creek Software, Inc.  pgpkey: http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI 48103




RE: Where are Struts messages found?

2001-04-11 Thread Scott Cressler

Your application's web.xml file (probably in your WEB-INF directory) should
include a servlet tag that defines and configures the ActionServlet.  Part
of that is something like:

init-param
  param-nameapplication/param-name
  param-valuecom.yourdomain.yourpackage.Resources/param-value
/init-param

This is used to find the messages file, which in this case would be the file
at:

WEB-INF/classes/com/yourdomain/yourpackage/Resources.properties

Scott

 -Original Message-
 From: James Howe [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 11, 2001 8:34 AM
 To: [EMAIL PROTECTED]
 Subject: Where are Struts messages found?
 
 
 I'm working with Struts and I'm trying to build an error page 
 for my JSP 
 application.   In looking at the Struts tag code I see 
 statements which 
 look like this:
 
 throw new JspException(messages.getMessage("getter.bean", 
 beanName)));  
 
 which looks like it should be populating the exception with 
 some useful 
 information.  However, when I execute this code in a 
 debugger, the message 
 assigned to the Exception is null because there is no message 
 with the name 
 "getter.bean".  Where would I find definitions for messages such as 
 "getter.bean", "optionsTag.iterator", etc?