xml里面写的spring url-pattern都是/
问题
通过jsp连接的请求都正确定位到正确的url
jsp处理
<%@ page import="com.magus.web.util.PropUtil;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
basePath = PropUtil.getPropertyByName("path");
%>
basePath等于配置文件里配置的绝对url,例如http://www.domain.org:8080/domain1
但是后台处理的post请求完毕后,return new ModelAndView(new RedirectView("add"));
url就会转向http://www.domain.org:28080/domain1/add,
服务架构师说不允许用request.getContextPath();要写死contextPath,
对于spring的DispatcherServlet,需要做如何变化才能使spring初始化的时候读取的webappcontext是绝对的url,
继承或者重写?