[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Why does <html:text property="..."/> has no value?
From:       Sebastian Stein <seb.stein () hpfsc ! de>
Date:       2005-11-30 16:33:00
Message-ID: 20051130163300.GA9929 () hpfsc ! de
[Download RAW message or body]

Hi,

I'm still in the process of learning struts... but I have a HTML form with
an input field:


<bean:define id="sourceDate" name="sourceDate" type="java.lang.String"/>
...
<html:text property="sourceDate" styleClass="input"/>

This string sourceDate is set in advance in a java class (extending Action):

sourceDate="2005/10/14";
request.setAttribute("sourceDate", sourceDate);

If I write in my jsp page <bean:write name="sourceDate"/> the correct string
is shown in the HTML output. So I'm sure that the value for sourceDate is
correctly handed over to the jsp page.

However, in the form above, the html input field does not contain the
string of sourceDate as default value. If I add name="sourceDate" to the
<html:text .../> line, I get the following exception:

javax.servlet.ServletException: No getter method for property sourceDate of
bean sourceDate

Is there a way to easily fix this?


Sebastian

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic