Spring Boot用浏览器关闭程序
来源:互联网 发布:淘宝网豆豆鞋 编辑:程序博客网 时间:2024/06/05 03:53
application.properties
#启动url shutdownendpoints.shutdown.enabled=true
index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%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> hello jsp <form action="${pageContext.request.contextPath}/shutdown" method="post"> <input type="submit" value="关闭"/> </form> </body></html>
在浏览器中访问jsp
http://localhost/sb/index.jsp
如果直接访问http://localhost/sb/shutdown会出现请求限定的错误,因为用浏览器直接跳转只能是GET
那这个Action只能用POST请求访问才会生效,所以利用form表单跳转来关闭程序
阅读全文
0 0
- Spring Boot用浏览器关闭程序
- Spring Boot用浏览器关闭程序
- 关闭spring boot的banner
- Spring Boot 程序用 log4j 替换 Logback
- Spring Boot的应用启动与关闭
- spring-boot 开启后立即关闭
- Spring Boot-V1.5.7关闭Banner
- Spring Boot的应用启动与关闭
- spring boot应用启动及关闭方式
- 第一个 Spring Boot 程序
- Spring Boot WebGL小程序
- 第一个Spring Boot程序
- Spring boot入门小程序
- Spring Boot 入门教程-入门程序
- 第一个Spring-boot程序
- Spring boot 入门程序详解
- 关于spring boot - 快速构建spring程序
- spring boot +spring stateMachine启蒙程序
- opencv基本矩阵操作
- 有效的mysql优化sql语句查询的方法
- 静态库lib的编写
- 【jquery】适用Deferred实现jquery将请求封装成函数
- QTextEdit更改特定某些行的字体格式
- Spring Boot用浏览器关闭程序
- LeetCode周练Contest-35代码解析(C++)
- Android WebView 内容图片宽度自适应
- c语言综合实验 学生成绩管理系统
- BZOJ 2597: [Wc2007]剪刀石头布 费用流
- python科学计算--核心工具包一瞥(二)(win10 64位,numpy,scipy,pandas,seaborn,wordcloud安装)
- matlab之求向量中出现最多的元素和频率
- Java基本语法---枚举
- 剑指offer面试题[9-2]-变态跳台阶