struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohan Radhakrishnan <Moh...@hclcomnet.co.in>
Subject html:text property problem
Date Fri, 07 Mar 2003 12:27:20 GMT
Hi,

      I am trying to use the following

<bean:define id="startdate" name="form" property='<%= "date[" + 0 + "]"
%>'/>

to set the property in a html:text box. The property is of type String[]. So
I am using the above indexed property access method.

<html:text property="date" value="<%=date.toString()%>"></html:text>

I have also put the following check in my form.

    public String getStartDateIndexed( int index ) {
		if( startDate_ == null ){
			startDate_ = new String[]{ new
DateUtility().getCurrentDate() };
		}
	return startDate_[ index ];
    }

along with pre-population of the html:text boxes. Inspite of all this
sometimes the following exception is thrown.

  Anybody see any chinks in the armour above. What more error checks does it
need ? Is it the right way with Struts 1.0 ?

java.lang.NullPointerException
	at
org.apache.struts.util.PropertyUtils.getIndexedProperty(PropertyUtils.java:3
72)
	at
org.apache.struts.util.PropertyUtils.getIndexedProperty(PropertyUtils.java:3
14)
	at
org.apache.struts.util.PropertyUtils.getNestedProperty(PropertyUtils.java:42
4)
	at
org.apache.struts.util.PropertyUtils.getProperty(PropertyUtils.java:453)
	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:503)
	at
org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:200)
	at
org.apache.jsp.visibleleftpanel_jsp._jspService(visibleleftpanel_jsp.java:21
7)

Thanks
Mohan

---------------------------------------------------------------------
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