For JSP debugging in Intellij there are some configurations that must be in order. The fact that Intellij always allows you to add a breakpoint on a JSP line does not necessarily imply that you’ve configured JSP debugging. In the following I refer to Intellij
8 configuration, w.r.t. previous versions you will need to do similar operations as the concepts are the same.
In order to enable JSP debugging you must do two steps: set a web application configuration in your project and add a web application server configuration.
Web application Configuration
: in order to have JSP debugging, you must
have a “web” facet in your project structure, pointing to the correct web.xml file. Depending on the kind of web application structure you are using, the facet may be detected automatically by Intellij (go anyway to check what it has done) or you may have
to add it manually. Remember in the “Java EE build settings” tab to set as anable “Create web facet exploded directory”; if you don’t want duplications, a trick is just to enable it and point to your already existing directory.
(Web) Application server
: Go to “edit configurations”, there you have
to add to configurations an application server, not launch the web server as an application like any other. In this way Intellij will be able to intercept JSP calls. In the list of application servers, you should have the default one, Tomcat. Be sure to have
a local Tomcat installation before you do this, and point to that when adding the web application server. The last trick is going to the “Deployment” tab and selecting as “Deployment source” the same facet that you configured in the previous step.
The same configuration works if you want to use another web application server, I tested it with the latest Caucho Resin releases and debugging works fine (it didn’t with the previous Intellij and Resin combinations).
If you don’t see Tomcat in the list of available application servers to add, check the plugins in the general Intellij settings pane: in the latest releases, more and more functionality has become “pluggable”, and even very basic functions may be disabled;
this plugin is called “Tomcat integration”.
Finally, it is surely not true that JSP files need to be under WEB-INF to be under debugging.
IDEA
断点
调试–基础篇
Debug 用来追踪代码的运行流程。我们通常会在程序运行过程中出现异常的时候,启用 Debug 模式来分析定位异常发生的位置,以及在运行过程中参数的变化。通常我们也可以启用 Debug 模式来跟踪代码的运行流程去学习三方框架的源码。而
IDEA
作为我们 JAVA 开发最常用的工具,所以我们对于
IDEA
的 Debug 更应该去了解一下。
2
断点
类型
IDEA
中对于 JAVA 的
断点
进行了分类,有如下的 4 类:
Java Line Breakpoints :行断
文章目录1. 设置
断点
2. 调试3. 调试的基本操作3.1 step over3.2 step into 跟 Force step into3.3 step out3.4 resume program3.5 mute breakpoints3.6 view breakpoints3.6 条件
断点
编写代码的时候,有时候我们需要跟踪代码的运行情况,使用
断点
调试就是一个不错的方法,接下来介绍一下如何在
IDEA
中使用
断点
进行调试
1. 设置
断点
直接在你需要打
断点
的代码的行号区域,
点
击,即可设置
断点
,如图所示
总:
断点
可用于java代码中,debugger可用于
jsp
页面。不过两者均可用于发现项目问题所在的位置。在实际项目中,bugger素来让程序员繁累,由此使用
断点
与debugger已是必备技能。
断点
,在java类中代码的前端设置
断点
,鼠标左键双
点
。
断点
设置后,在debug模式下启动项目运行。项目运行到
断点
代码时,会自动进入
断点
页面。按f6
断点
向下进行,f8跳入下一个
断点
,f7跳出代码。可在
断点
进...
在使用SpringMVC开发管理网站过程中,服务器返回了较多的session信息,导致浏览器端显示的html代码被截断。
如在浏览器的F12开发者工具里看到最后一行由本应该的
<ul class="list-group" id="taskList">
被打印成了<ul class="li
草草结束了,这什么鬼?
当然后面的页面也全没有了显示。
废话不多说了,反正把
jsp
页面开头...