struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Kaja.Mohid...@bmwmcext.com>
Subject RE: help ApplicationResources.properties
Date Tue, 25 Mar 2003 16:52:41 GMT
Rajesh,
  Let us first try whether ApplicationResources file is working or not..

  Add key="prompt.title" in your jsp page..Add prompt.title with some name in ApplicationResources.properties
file

  Let us see it displays that title in your Browser,,If so Resource file is working fine..


  Here I have seen your Validate() function everything is good,,But i have doubt you put capital
"PORT_PCT"(should be the field name), you try to use the same case which you are using in
jsp page..

-----Original Message-----
From: Rajesh.Jayabalan@lazard.com [mailto:Rajesh.Jayabalan@lazard.com]
Sent: Tuesday, March 25, 2003 11:30 AM
To: struts-user@jakarta.apache.org
Subject: help ApplicationResources.properties


Hi,

 I have the following in the web.xml
<servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>lam.mffs.action.MyActionServlet</servlet-class>
      <init-param>
        <param-name>application</param-name>
        <param-value>lam.mffs.form.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>
        <init-param>
          <param-name>detail</param-name>
          <param-value>2</param-value>
        </init-param>
        <init-param>
          <param-name>validate</param-name>
          <param-value>true</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

I have MyActionServlet extend ActionServlet with init method as

public void init() throws ServletException
  {
    super.init();
    ConvertUtils.register(new BigDecimalConverter(null),
java.math.BigDecimal.class);

  }

now when I try to do the following in my formbean validate method

if (this.getPort_pct() == null)
    {
      LamLog.log(this, LamLog.INFO,"Error port_pct is null");
      errors.add("PORT_PCT",
                 new ActionError("errors.bigdecimal2"));
    }

I get  a java.lang.NullPointerException at

 errors.add("PORT_PCT",
                 new ActionError("errors.bigdecimal2"));

What is wrong.. I tried the other way of

<message-resources
    parameter="lam.mffs.form.ApplicationResources"/>

in the struts-config.xml but even that gave me the same error

Regards
Rajesh J







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


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


Mime
View raw message