struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamal Najmi <jamalna...@yahoo.com>
Subject Validator question
Date Sat, 08 Feb 2003 05:07:43 GMT

I am developing my Struts first application with Strus 1.3b.  I am using Validator Frameqork
that is a part of Struts Commons.  I intend to use Validator Framework with the ValidatorActionForm
instead of usual DynaActionForm.  What I have done is really try to follow the registration
example that is a part of the Struts example.  

My Action Farm is defined as:

public class AssUserForm  extends org.apache.struts.validator.ValidatorForm

My strut_config.xml is set up as:

<form-bean name="addUserForm" type="com.macrosoftinc.web.AddUser">

The action related to this form is:

<action path="/addUserSave" scope="request"

      type="com.macrosoftinc.web.AddUserAction" unknown="false"

      name="addUserForm"

     validate="true"

    input="/addUser.jsp">

   <forward name="success" path="/userList.jsp"/>

  <forward name="failure path="/addUser.jsp"/>

</action>

 

Validation XML has just one validation rule in it:

<form name="addUserForm">

    <field property="userId"

      depends="required,maxlength" key="${var:maxlength}" resource="false" />

      <var>

          <var-name>maxlength</var-name>

          <var-value>30</var-value>

    </var>

 </field> 

 </form>

I have following code in my addUser.jsp to display any error messages:

<logic:messagesPresent>
   <bean:message key="errors.header"/>
   <ul>
   <html:messages id="error">
      <li><bean:write name="error"/></li>
   </html:messages>
   </ul><hr>
</logic:messagesPresent>

When I run the app, I get the following error:

 

root cause 

java.lang.NullPointerException

        at java.util.Hashtable.put(Hashtable.java:380)

        at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:234)

        at org.apache.struts.taglib.html.MessagesTag.doStartTag(MessagesTag.java:250)

        at org.apache.jsp.addUser_jsp._jspService(addUser_jsp.java:123)

 

Any ideas why I am getting this error?  I will really appreciate the help.  It looks like
I am not defining the error properly and the MessageTag is throwing excetpion.  

I will really appreciate any help I can get.

Thanks!!

Jamal  



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message