JBuilderX中的web module中的Context root设置好以后,Servlet无法访问
在JBuilderX中的web module中的Context root设置好以后比如名字叫"test"
则访问一个jsp比如jsp1.jsp,而且这个jsp在根下,则http://192.168.0.1/test/jsp1.jsp
如果把Context root设置成空 则http://192.168.0.1/jsp1.jsp
这还好说,怎么说jsp文件用相对路径也能解决的
可是访问Servlet就不行了,比如一个Servlet在web.xml中定义的url为/TestServlet
Context root设置为"test"那么在jsp1.jsp中访问的时候就得是/test/TestServlet
如果Context root设置为空则/TestServlet就可以了
这给开发带来了麻烦,各位有没有方法解决阿,不论Context root怎么设置,代码不用改
尤其是访问Servlet的时候。
先谢谢各位了