[英]Change Context root for the application deployed in tomcat
This is my web.xml 这是我的web.xml
<display-name>Schedule_FTP</display-name>
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Schedule_FTP</servlet-name>
<jsp-file>/Schedule_FTP/main.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>Schedule_FTP</servlet-name>
<url-pattern>/Schedule_FTP/*</url-pattern>
</servlet-mapping>
</web-app>
Basically Main.jsp invokes a java class. 基本上Main.jsp会调用一个Java类。
When I reload the applciation in tomcat manager url. 当我在tomcat管理器URL中重新加载应用程序时。 It get the message as below.
它得到如下消息。
OK - Reloaded application at context path /Schedule_FTP
I want this to be, - context path /Schedule_FTP/main.jsp 我希望它是-上下文路径/Schedule_FTP/main.jsp
Can somebody please help me to undesrtand what am i missing? 有人可以帮我取消遗漏吗?
Server details: Apache Tomcat/7.0.47, JVM Version 1.6.0_35-b10 服务器详细信息:Apache Tomcat / 7.0.47,JVM版本1.6.0_35-b10
You could try to add an additional url pattern to your servlet mapping : 您可以尝试向servlet映射中添加其他网址模式:
<servlet>
<servlet-name>Schedule_FTP</servlet-name>
<jsp-file>/Schedule_FTP/main.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>Schedule_FTP</servlet-name>
<url-pattern>/Schedule_FTP/main.jsp</url-pattern>
<url-pattern>/Schedule_FTP/*</url-pattern>
</servlet-mapping>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.