REST:JSPs only permit GET POST or HEAD

    技术2023-05-15  78

    1.在jsp标签上添加属性isErrorPage=“true”

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isErrorPage="true" %>

    2.借用重定向

    重新写一个执行success的方法,返回时先重定向到该方法 @RequestMapping(value = "/user",method = RequestMethod.DELETE) public String del(String id){ System.out.println("del......."+id); return "redirect:/tosuccess"; } @RequestMapping("/tosuccess") public String test(){ return "success"; }

    借鉴自: https://blog.csdn.net/weixin_45165669/article/details/104617304

    Processed: 0.018, SQL: 9