test

@Validation public class PostItemAction extends BaseAction { //here BaseAction extends ActionSupport implements ModelDriven, ServletResponseAware, ServletRequestAware @Validations( requiredStrings={ @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "item.itemName", message = "", key = "errorItemNameRequired"), @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "item.itemdescription", message = "", key= "errorItemDescriptionRequired"), @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "amount", message = "", key= "errorStartPriceRequired") } ) public String sellItem() throws IOException{ return SUCCESS; } } ------------------ Here item.itemName--> item is object of ItemVO.java (simple pojo or talking to db..) itemName is field of ItemVo --------------------- key -->errorItemNameRequired-->you have in Resource file --------- JSP contains .. something like <s:form action="PostItemAction_sellItem"> <s:textfield name="item.itemName" /> <s:textfield name="item.itemdescription" /> <s:datetimepicker name="item.startDate" /> </s:form> --------- strust.xml-->entry <action name="PostItemAction_*" method="{1}" class="com.action.PostItemAction"> <result>/item/yourother.jsp</result> </action>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值