zoukankan      html  css  js  c++  java
  • JSP | IDEA 配置 JSP 模板

    1. 新建 jsp 文件时的模板

    在第 5 步输入下面模板代码:

    <%--
      Created by IntelliJ IDEA.
      User: ${USER}
      Date: ${DATE}
      Time: ${TIME}
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    
    %>
    <html>
    <head>
    <base href="<%=basePath %>" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Insert title here</title>
    </head>
    <body>
    
    </body>
    </html>
    
    1. 快捷键快速生成 jsp 模板

    在第7步填入下面代码:

    <%--
      Created by IntelliJ IDEA.
      User: $USER$ 
      Date: $DATE$
      Time: $TIME$
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    
    %>
    <html>
    <head>
    <base href="<%=basePath %>" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Insert title here</title>
    </head>
    <body>
    
    </body>
    </html>
    

    第8步编辑变量

    配置完毕

    • 新创建 jsp 文件
      或者
    • 在已有的 jsp 文件输入 jsp 按下 Tab 键
      效果如下
    <%--
      Created by IntelliJ IDEA.
      User: RioTian
      Date: 2021/9/25
      Time: 15:48
    --%>
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <html>
    <head>
    <base href="<%=basePath %>" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Insert title here</title>
    </head>
    <body>
    
    </body>
    </html>
    

    The desire of his soul is the prophecy of his fate
    你灵魂的欲望,是你命运的先知。

  • 相关阅读:
    模拟_大数字符串(HDU_2054)
    DP_字串匹配(HDU_1501)
    动态字典树_字串标记查找+大数(HDU_4099)
    动态字典树_字串查找匹配(HDU_1075)
    动态字典树+DFS(HDU_1298)
    动态字典树_拆分查找(HDU_1247)
    动态字典树_统计前缀子串(HDU_1251)
    动态字典树_统计子串(HDU_2846)
    字典树讲解
    HTML5语义标签的实践(blog页面)
  • 原文地址:https://www.cnblogs.com/RioTian/p/15334596.html
Copyright © 2011-2022 走看看