标签:
1,前台jsp中form表单,a链接中不加/,可用request.getContextPath();获取工程根目录;
2,web.xml中注册servlet时<url-pattern>需要使用/代表web工程的根目录;
3,在servlet中发生重定向跳转时,用request.getContextPath();获取工程的根目录;
jsp ,servlet中路径
原文地址:http://blog.csdn.net/ring_to_ping/article/details/46352321