IntelliJ IDEA and Tomcat problem

Hi,

I am new to IDEA and tomcat so I am probably doing something so obviously wrong but I can't figure it out. I am trying to make a simple Hello World java web application. I believe I have everything setup correctly as I followed this tutorial: http://wiki.jetbrains.net/intellij/Creating_a_simple_Web_application_for_Tomcat_in_IntelliJ_IDEA_12

The only problem I have is that when I run the index.jsp it takes me to http://localhost:8080/index.jsp and shows the tomcat "successfully installed" page, instead of the helloworld page. Is there a setting within IDEA that I might have missed? or is this a tomcat issue? I really have no idea.

If you need more information, please ask.

Thanks for any help.

Jay

2 comments

Make sure that there is no other instance of Tomcat server when you're running your application. Just look in your process list and kill if there is any. After that try to re-run your application.

0

The page you want IDEA to open is set in the "After Launch" field on the "Server" tab in the run/debug configuration. The context to deploy your webapp to is set on the "Deployment" tab's "Application context" field. You need to make sure the deploy context and the context in the start page match:
http://localhost:8080/contextName/index.jsp
/contextName
For example:
http://localhost:8080/hello/index.jsp
/hello
or
http://localhost:8080/example/index.jsp
/example
sceenshot.png

By default, tomcat has a Welcome to Tomcat webapp in the root context - that is a context of '/' making the URL:http://localhost:8080/index.jsp . If you want to deploy your webapp in the root context, you need to stop tomcat and go to the directory {tomcat-install-dir}/webapps and delete the ROOT directory. You can then deploy a root webapp by setting the context in your run configuration to just '/' (without the quotes).

0

Please sign in to leave a comment.