日期:2014-05-17 浏览次数:20713 次
<html:form action="/userLogin" focus="userName"> <html:text property="userName" size="16" /> <html:submit property="login" value="Submit" /> </html:form>
userName=userLoginForm.getUserName(); request.setAttribute("userName", userName); return mapping.findForward("success");
<action-mappings > <action attribute="userLoginForm" input="/form/userLogin.jsp" name="userLoginForm" path="/userLogin" scope="request" type="com.yourcompany.struts.action.UserLoginAction"> <forward name="fault" path="/form/userLogin.jsp" redirect="false" /> <forward name="success" path="/form/success.jsp" redirect="false" /> </action> </action-mappings>
[<bean:write name="userName" scope="request" />]