zoukankan      html  css  js  c++  java
  • 016 SpringMVC中重定向

    1.介绍

      

    2.index

     1 <%@ page language="java" contentType="text/html; charset=utf-8"
     2     pageEncoding="utf-8"%>
     3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     4 <html>
     5 <head>
     6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     7 <title>Insert title here</title>
     8 </head>
     9 <body>
    10     <a href="RedirectTest">Test Redirect</a>    
    11     <br><br>
    12 
    13     <a href="BeanNameTest">Test BeanNameTest</a>    
    14     <br><br>
    15 </body>
    16 </html>

    3.concroller

     1 package com.spring.it;
     2 
     3 import org.springframework.stereotype.Controller;
     4 import org.springframework.web.bind.annotation.RequestMapping;
     5 
     6 @Controller
     7 public class RedirectTest {
     8     @RequestMapping("/RedirectTest")
     9     public String hello() {
    10         System.out.println("ha ha");
    11         return "redirect:/index2.jsp";
    12     }
    13 }

    4.效果

      

  • 相关阅读:
    git相关整理
    cookie、sessionStorage和localStorage
    AJAX学习笔记
    json web token
    加密算法
    单点登陆
    给手机网络添加手动代理
    oracle数据库索引
    类加载器
    类加载过程
  • 原文地址:https://www.cnblogs.com/juncaoit/p/8490838.html
Copyright © 2011-2022 走看看