struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksandar Matijaca <amatij...@gmail.com>
Subject embedding forms
Date Thu, 07 Jul 2005 18:01:22 GMT
Hi there,

I am having a problem, trying to embed one ValidatorForm inside of another 
--- specifically this is the situation:

I have a class InstitutionForm and a class DnaForm -- I am trying to do the 
following

public class InstitutionForm extends ValidatorForm {

private DnaForm dnaForm;

private String institution_name;


public String getInstitution_name() {
return institution_name;
}

public void setInstitution_name(String institution_name) {
this.institution_name = institution_name;
}

public DnaForm getDnaForm() {
return dnaForm;
}
public void setDnaForm(DnaForm dnaForm) {
this.dnaForm = dnaForm;
}

}


public class DnaForm extends ValidatorForm {

private String first_name;

public String getFirst_name() {
return first_name;
}
public void setFirst_name(String first_name) {
this.first_name = first_name;
}

}


In my JSP, I have the following:

<html:form action="/processRequestAccess" method="POST">
<table border="1">
<tr>
<td><bean:message key="institution-name" /></td>
<td><html:text property="institution_name" /></td>
<td><bean:message key="title" /></td>
<td></td>
</tr>
<tr>
<td><bean:message key="address1" /></td>
<td></td>
<td><bean:message key="first-name" /></td>
<td><html:text property="dnaForm.first_name" /></td> <!-- DOESN'T LIKE
THIS 
-->
</tr>
............
.............

</html:form>

the rendered JSP produces this:

12:25:33,653 INFO [TilesRequestProcessor] Tiles definition factory found for 
request processor ''.
12:25:36,567 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Invalid argument looking up property 
dnaForm.first_name of bean org.apache.struts.taglib.html.BEAN
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:1017)
at org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(
BaseFieldTag.java:153)
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java
:96)
at 
org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp._jspx_meth_html_text_1
(org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp:342)
at 
org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp._jspx_meth_html_form_0
(org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp:154)
at org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp._jspService(
org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp:81)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)


I am using JBoss 4.x

It is obvious, that the jsp rendering does not 'like' the
dnaForm.first_name--- is there a decent way of embedding these
Validatorform, one inside of
the other,
or should I just do a InstutionForm extends DnaForm instead??

Thanks, Alex.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message