<field property="userName" depends="required">
<arg0 key="prompt.userName"/>
(该参数将在显示错误信息是从xxx.properties读取prompt.userName,填入{}方括号里,取代0。如果是arg1将将填入{1}位置,以此类推。
</field>
</form>
不需要在action里做任何处理。只管forward就行了。作为forward的目标页,不需要任何有关用于处理出错信息的处理。
83.服务器报
The requested resource (/xxxx/xxx.htm) is not available.的很奇怪的一个的可能原因
在web.xml中定义的tld,没有找到
或者是lib目录下的包太多出现了问题。
如
<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/spring.tld</taglib-location>
</taglib>
如WEB-INF目录下不存在spring.tld的话,就会报上边的错误
84.
spring的xxx-servlet.xml的使用SimpleFormController系列的类问题:
<bean id = "priceIncreaseForm" class="PriceIncreaseFormController">
<property name="sessionForm"><value>true</value></property>
<property name="beanName"><value>priceIncrease</value></property>
<property name="commandClass"><value>PriceIncrease</value></property>
<property name="formView"><value>priceIncrease</value></property>
<property name="successView"><value>hello</value></property>
<property name="productManager">
<ref bean="prodMan"/>
</property>
</bean>
这里要注意几个问题:
(1)上边的PriceIncrease是了类名,必须在classes里存在该类,否则报:
PropertyVetoExceptionsException: 1 errors:-- ErrorCodedPropertyVetoException: message=[Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property named 'commandClass'; nested exception is:
java.lang.IllegalArgumentException: Invalid class name [PriceIncrease]: PriceIncrease]; errorCode=[typeMismatch]