Forwarding controller dedicated to jsp to jsp/html -- study notes


    <!-- 专用于jsp到jsp/html的转发控制器 -->
    <bean name="/index.action" class="org.springframework.web.servlet.mvc.ParameterizableViewController">
        <!-- 转发到真实视图名 -->
        <property name="viewName" value="/WEB-INF/05_index.jsp"/>
    </bean>
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>演示二个控制器</title>
  </head>
  <body>

    <a href="${pageContext.request.contextPath}/index.action" style="text-decoration:none">首页</a> 

    <hr/>

    <form action="${pageContext.request.contextPath}/add.action" method="POST">
        <table border="2" align="center">
            <tr>
                <th>姓名</th>
                <td><input type="text" name="username"/></td>               
            </tr>
            <tr>
                <th>性别</th>
                <td>
                    <input type="radio" name="gender" value="男"/>男
                    <input type="radio" name="gender" value="女" checked/>女
                </td>               
            </tr>
            <tr>
                <th>入职时间</th>
                <td>
                    <input type="text" name="hiredate" value="2018-4-22"/>
                </td>               
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="提交"/>
                </td>
            </tr>
        </table>
    </form>

  </body>
</html>
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>首页</title>
  </head>
  <body>

    <font style="font-size:111px">员工管理系统</font>

  </body>
</html>

Forwarding controller dedicated to jsp to jsp/html -- study notes
Forwarding controller dedicated to jsp to jsp/html -- study notes

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324605595&siteId=291194637