Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run/debug jsp page from within IntelliJ using Tomcat server

I created a new project and created artifact for it. When I run Tomcat from command prompt and go to: http://localhost:8080/IntelProject1/index.jsp

I can see my page.

But when I try to run it from IntelliJ, it opens empty page: http://localhost:8080

and if I try to go to: http://localhost:8080/IntelProject1/index.jsp

this is what it displays:

HTTP Status 404 - /IntelProject1/index.jsp

type Status report

message /IntelProject1/index.jsp

description The requested resource is not available.

Apache Tomcat/7.0.57

The reason it is able to find it from tomcat is because I edited server.xml file in tomcat/conf folder:

<Context path="/IntelProject1" docBase="C:\Users\ibogojevic\Desktop\IntelProject1\web\JSP" />

But I want to be able to open it and debug from within IntelliJ

Maybe my artifact is wrong. Any thoughts?

like image 655
Angelina Avatar asked Feb 05 '15 14:02

Angelina


2 Answers

Open Debug Configuration in IntelliJ IDEA and make sure that Deploy applications configured in Tomcat checkbox is checked as it shown on the screenshot.

enter image description here

like image 93
Alexander Pranko Avatar answered Oct 24 '22 16:10

Alexander Pranko


For me it worked with:

File >Project Structure >Artifacts

In the

Output Layout on the right side >"Available Elements?"

right click on the available libraries ( for me it was "Spring MVC-4.2.4.RELEASE")

Put into Lib

And it worked.

like image 43
Suisse Avatar answered Oct 24 '22 17:10

Suisse