please supply the applicationContext.xml definition for 'testDate'
e.g. web..xml
<action name="springExample" class="springAction">
<result name="success">
/WEB-INF/view/springExample.jsp
</result>
</action>
<beans default-autowire="autodetect">
<bean id="thingManager"
class="org.apache.struts2.portlet.example.spring.ThingManager">
</bean>
<bean id="springAction"
class="org.apache.struts2.portlet.example.spring.SpringAction"
singleton="false">
<property name="thingManager">
<ref bean="thingManager" />
</property>
</bean>
</beans>
M-
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "longhao" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Tuesday, April 24, 2007 7:19 AM
Subject: Null date become today in map when use textfield tag
TestDateAction.java
public class TestDateAction extends ActionSupport {
private Date singleDate;
private Map mapDate;
private List listDate;
@Override
public String execute() throws Exception {
return super.execute();
}
....set get methods
}
index.jsp
....jsp tag input
<form action="testDate.action">
<s:textfield name="mapDate['today']"/>
<s:textfield name="singleDate"/>
<s:textfield name="listDate[0]"/>
<input type="submit"/>
<form>
struts.xml
<package name="default" extends="struts-default">
<action name="testDate" class="testDate">
<result name="success">index.jsp</result>
</action>
</package>
I input nothing in all three textfield then submit.
In TestDateAction three parameters are all null in valuestack.
But after come back to index.jsp, mapDate['today'] 's value become today.
so magic.
The Null date value become today in Textfield tag. Perhaps this is a bug
of ognl when use textfield.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]