[prev in list] [next in list] [prev in thread] [next in thread]
List: struts-user
Subject: Re: Why does <html:text property="..."/> has no value?
From: "Gaet" <gaetmail () free ! fr>
Date: 2005-11-30 16:38:18
Message-ID: 026101c5f5cc$7895e4b0$3c3010ac () glpg
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Please send your code of tag <html:text>
But if you specify 'sourceDate' in the name that means that you will look in the bean \
sourceDate and not that you will display its value...don't know if you see the \
difference...send more lines of code
Cordialement,
----- Original Message -----
From: Sebastian Stein
To: user@struts.apache.org
Sent: Wednesday, November 30, 2005 5:33 PM
Subject: Why does <html:text property="..."/> has no value?
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
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1522" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000080>Please send your code of tag
<html:text></FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV><FONT color=#000080>But if you specify 'sourceDate' in the name that means
that you will look in the bean sourceDate and not that you will display its
value...don't know if you see the difference...send more lines of
code</FONT></DIV>
<DIV><BR>Cordialement,
<STYLE type=text/css>
<!--
body{
font-family:verdana;
font-size:10pt;
color:#000099;
}
a{
font-size:8pt;
color:#000099;
}
span.texte7, span.texte7Gras, span.texte7Italique{
font-size:7pt;
}
span.texte8, span.texte8Gras, span.texte8Italique{
font-size:8pt;
}
span.texte7Gras, span.texte8Gras{
font-weight:bold;
}
span.texte7Italique, span.texte8Italique{
font-style: italic;
}
-->
</STYLE>
<BR><IMG alt="" isMap src="cid:025a01c5f5cc$7844de80$3c3010ac@glpg"
useMap=#signatureMap border=0> <MAP name=signatureMap><AREA shape=RECT
target=_blank alt="Visiter le site Internet du CCPB14" coords=18,12,125,90
href="http://www.ccpb14.org"><AREA shape=RECT target=_blank
alt="Ecrire un e-mail à Mr Gaëtan LEPARGNEUL" coords=155,58,325,73
href="mailto:g.lepargneul@ccpb14.org"><AREA shape=RECT target=_blank
alt="Visiter le site Internet du CCPB14" coords=155,75,315,90
href="http://www.ccpb14.org"></MAP></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 \
2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">----- Original Message \
----- </DIV> <DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=seb.stein@hpfsc.de href="mailto:seb.stein@hpfsc.de">Sebastian
Stein</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=user@struts.apache.org
href="mailto:user@struts.apache.org">user@struts.apache.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, November 30, 2005 5:33
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Why does <html:text
property="..."/> has no value?</DIV>
<DIV><BR></DIV>Hi,<BR><BR>I'm still in the process of learning struts... but I
have a HTML form with<BR>an input field:<BR><BR><BR><bean:define
id="sourceDate" name="sourceDate"
type="java.lang.String"/><BR>...<BR><html:text property="sourceDate"
styleClass="input"/><BR><BR>This string sourceDate is set in advance in a
java class (extending
Action):<BR><BR>sourceDate="2005/10/14";<BR>request.setAttribute("sourceDate",
sourceDate);<BR><BR>If I write in my jsp page <bean:write
name="sourceDate"/> the correct string<BR>is shown in the HTML output. So
I'm sure that the value for sourceDate is<BR>correctly handed over to the jsp
page.<BR><BR>However, in the form above, the html input field does not contain
the<BR>string of sourceDate as default value. If I add name="sourceDate" to
the<BR><html:text .../> line, I get the following
exception:<BR><BR>javax.servlet.ServletException: No getter method for
property sourceDate of<BR>bean sourceDate<BR><BR>Is there a way to easily fix
this?<BR><BR><BR>Sebastian<BR><BR>---------------------------------------------------------------------<BR>To \
unsubscribe, e-mail: <A
href="mailto:user-unsubscribe@struts.apache.org">user-unsubscribe@struts.apache.org</A><BR>For \
additional commands, e-mail: <A
href="mailto:user-help@struts.apache.org">user-help@struts.apache.org</A><BR><BR></BLOCKQUOTE></BODY></HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic