ActionForm中的表单跨页

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC 
	"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" 
	"http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config>
	<data-sources />
	<form-beans>
		<form-bean name="regForm" type="com.struts.form.Reg1Form" />

	</form-beans>
	<global-exceptions />
	<global-forwards />
	<action-mappings>
		<action name="regForm" forward="/login1.jsp" path="/tologin2" scope="session">
			<set-property property="cancellable" value="true" />
		</action>
		<action name="regForm" path="/reg"
			type="com.struts.action.RegAction">
			<set-property property="cancellable" value="true" />
		</action>

	</action-mappings>
	<message-resources parameter="com.struts.ApplicationResources" />
</struts-config>

 

 

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html>
	<head>
		<title>注册页面1</title>
	</head>
	<body>
		<html:form action="/tologin2">
			username: <html:text property="username" />
			<br />
			password : <html:password property="password" />
			<br />
			<html:submit value="到达下一个页面" />
		</html:form>
	</body>
</html>

 

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html>
    <head>
        <title>注册页面2</title>
    </head>
    <body>
        <html:form action="/reg">
                phone : <html:text property="phone" />
            <br />
                address : <html:text property="address" />
            <br />
            <html:hidden property="page" value="2" />
            <html:submit value="提交" />
        </html:form>
    </body>
</html>
 

 

你可能感兴趣的:(apache,html,bean,jsp,struts)