Its part of 1.0

this is what the ActionServlet does on start up. Snippet from
org.apache.struts.action.ActionServlet class.

    protected void initApplication() throws ServletException {

        String value = getServletConfig().getInitParameter("application");
        if (value == null)
            return;
        String factory =
            getServletConfig().getInitParameter("factory");
        if (debug >= 1)
            log(internal.getMessage("applicationLoading", value));
        try {
            String oldFactory =
                MessageResourcesFactory.getFactoryClass();
            if (factory != null)
                MessageResourcesFactory.setFactoryClass(factory);
            MessageResourcesFactory factoryObject =
                MessageResourcesFactory.createFactory();
            application = factoryObject.createResources(value);
            MessageResourcesFactory.setFactoryClass(oldFactory);
            value = getServletConfig().getInitParameter("null");
            if (value == null)
                value = "true";
            if (value.equalsIgnoreCase("true") ||
                value.equalsIgnoreCase("yes"))
                application.setReturnNull(true);
            else
                application.setReturnNull(false);
        } catch (Throwable e) {
            log(internal.getMessage("applicationResources", value), e);
            throw new UnavailableException
                (internal.getMessage("applicationResources", value));
        }
        getServletContext().setAttribute(Action.MESSAGES_KEY, application);

    }

-----Original Message-----
From: Wellie W. Chao [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 11:01 PM
To: Struts Users Mailing List
Subject: RE: ApplicationResources.properties


Is the "application" parameter a relic from 1.0 or is it required in 1.1? I
have an entry in struts-config.xml that seems to serve the same purpose:

<message-resources
parameter="com.mycompany.myproject.ApplicationResources"/>

The reason I ask is that I recently began having problems accessing entries
in ApplicationResources. I'll try adding it to web.xml.

-----Original Message-----
From: srinivas [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 2:35 PM
To: Struts Users Mailing List
Subject: RE: ApplicationResources.properties


hello,
u need to have it in your classpath and  hence under /webapp only
In fact u can place in any directory u want under classes and configure ur
web server, in case of tomcat its like this.
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>com.test.properties.ApplicationResources</param-value>
    </init-param>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

regards,
srinivas
-----Original Message-----
From: K J [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 10:14 PM
To: Struts Users Mailing List
Subject: ApplicationResources.properties


In the struts example application, this properties
file is under both /source and /webApp. does it need
to be under both directories?

thanks.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to