eFormController(2)
ê±??:2011-03-14
train-servlet.xml
formView?¨ò??aregister??ó|?ò??μ?±íμ¥ìá??ò3??register.jsp
successView?¨ò??asuccess??ó|ìá??3é1|μ???ê?ò3??success.jsp
<bean id="RegisterStudentController" class="Action.RegisterStudentController">
?? <property name="formView">
???? <value>register</value>
?? </property>
?? <property name="successView">
???? <value>success</value>
?? </property>
</bean>
<bean id="simpleUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
?? <props>
???? <prop key="/home.mvc">HomeController</prop>
???? <prop key="/register.mvc">RegisterStudentController</prop>
?? </props>
</property>
</bean>
register.jsp: <%...@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%...
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
?? <head>
???? <base href="<%=basePath%>">
???? <title>My JSP ''index.jsp'' starting page</title>
???? <meta http-equiv="pragma" content="no-cache">
???? <meta http-equiv="cache-control" content="no-cache">
???? <meta http-equiv="expires" content="0">
???? <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
???? <meta http-equiv="description" content="This is my page">
???? <!--
???? <link rel="stylesheet" type="text/css" href="styles.css">
???? -->
?? </head>
?? <body>
?? <form action="<%=request.getContextPath() %>/register.mvc" method="post">
???? name:<input type="text" name="name"/></br>
???? sex:<input type="text" name="sex"/></br>
???? <input type="submit" value="submit"/>
?? </form>
?? </body>
</html>
success.jsp <%...@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%...
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
?? <head>
???? <base href="<%=basePath%>">
???? <title>My JSP ''index.jsp'' starting page</title>
???? <me |