一、配置 Project Structure
二、IntelliJ IDEA 基本设置
我最喜欢的主题:Material(Arc Dark),颜色和字体:visual Studio Code Dark Plus
三、编码快捷键设置
补充一个:Ctrl + Alt + V自动补全返回值,注意和有道翻译词典快捷键冲突,需要将其关闭,才能正常使用。
也可以自己设置一些快捷键:
- syso
设置 syso 表示:System.out.println();
点击 Apply 应用即可
2. main
前几步同上
设置适用范围即可
四、IDEA 的项目目录
五、修改一些默认的模板
为了方便使用,可以修改一些常用的模板使其更加符合自己的需求:
比如:Filter Annotate Class.java
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
@javax.servlet.annotation.WebFilter("/*")
public class ${Class_Name} implements javax.servlet.Filter {
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, java.io.IOException {
chain.doFilter(req, resp);
}
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException {
}
public void destroy() {
}
}
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
Servlet Annotated Class.java
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
@javax.servlet.annotation.WebServlet("/${Entity_Name}")
public class ${Class_Name} extends javax.servlet.http.HttpServlet {
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
}
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
this.doPost(request,response);
}
}
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
参考:
【1】https://blog.csdn.net/u014297148/article/details/78819803
【2】https://www.jianshu.com/p/572772f84105?utm_source=oschina-app