wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts and Validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and Validator" Watch "Struts and Validator" New topic
Author

Struts and Validator

Oscar Diaz
Greenhorn

Joined: Apr 16, 2004
Posts: 3
I'm working on Struts 1.1, I have a logon page running smoothly with Validator even with the client side validation, this part is OK since initially I don't have to retrieve any info from the database.
But I have an issue with an editing section:
A client click on an Enterview ID for editing purposes.
I execute an Action that retrieve all the enterview's data from a database and then I redirect the action to my editing page and I get the following.
java.lang.NullPointerException
at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:316) at org.apache.jsp.enterv_ins_edit_jsp._jspx_meth_html_javascript_0(enterv_ins_edit_jsp.java:665)at org.apache.jsp.enterv_ins_edit_jsp._jspService(enterv_ins_edit_jsp.java:106)at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

When the final servlet is rendered, this is the problematic-line 665 described above:
int _jspx_eval_html_javascript_0 = _jspx_th_html_javascript_0.doStartTag();
this is the code associated to enterv_edit.jsp, that has the problem:
<html:javascript formName="dynEntReviewForm"/>
these are the actions in my struts-admin.xml
<!--this action retrieve the data from my DB-->
<action path="/adm_edit_enterviews"
type="com.mycomp.admin.actions.EditEntervReviewAction"
name="dynEntReviewForm"
scope="request" validate="false">
<forward name="ent" path="/enterv_edit.jsp" redirect="false"/> </action>
<!--this action update the data to my DB-->
<action path="/adm_upd_enterviews"
type="com.mycomp.admin.actions.UpdEntervReviewAction"
name="dynEntReviewForm"
scope="request"
validate="true"
input="/enterv_ins_edit.jsp">
<forward name="ent" path="/adm_enterviews.do" redirect="false"/> </action>
This is the Dynamic form
<form-bean name="dynEntReviewForm"
dynamic="true"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="type_id" type="java.lang.Integer"/>
<form-property name="desc_txt" type="java.lang.String"/>
</form-bean>
If I eliminate the javascript tag in my jsp page, then I get the display page but the validator doesn't work.
I have tried for 2 days but I am already dumb with this issue,
any help will be appreciated


oscar
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

We've got a whole forum dedicated to Struts! -- So I'm moving this over there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts and Validator