URL issue with tomcat include project name

前端 未结 3 1059
天涯浪人
天涯浪人 2020-12-16 22:00

I am using Eclipse for J2EE project... one device send request to my side and url like

http://myIP:myPort/corporationweb/Controller

相关标签:
3条回答
  • 2020-12-16 22:33

    Rightclick project in Eclipse, choose Properties, go to Web Project Settings and set Context root to /.

    enter image description here

    This will let Eclipse deploy the project on context root instead of project name (which is the default).


    Unrelated to the concrete problem, you really need to ensure that your application is written the way so that it does not care on which context path the application is been deployed. This is namely a server specific setting which is not controllable from inside your project. Make use of HttpServletRequest#getContextPath() the smart way.

    0 讨论(0)
  • 2020-12-16 22:36

    If you want to make "VirtualTest" as default application for your project, and not showing this name in URL, you can simply change project name to "root", which is a special name for the default application.
    Your URL will be like:

    http://localhost:8080/corporationweb/Controller
    0 讨论(0)
  • 2020-12-16 22:51

    If you are using Eclipse. Go to server and remove the unwanted project which are Synchronized, then restart your server. Worked for me

    0 讨论(0)
提交回复
热议问题