我使用的是JSF 2.0.5,Tomcat 7.0.12和漂亮的面板。在JSF中處理部分URL
我的web.xml文件:
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
我的漂亮文件配置:
<url-mapping>
<pattern>/</pattern>
<view-id>/jsp/index.jsf</view-id>
</url-mapping>
我的index.jsp文件是空的。
我的問題是,當我在url'foo.com'中寫入時,他最終重定向(301)到 http://www.foo.com/jsp/index.jsf。
意味着,在我的聽衆階段:
HttpServletRequest req = (HttpServletRequest)context.getExternalContext().getRequest();
StringBuffer requestUrl = req.getRequestURL(); // i get http://www.foo.com/jsp/index.jsf
有人能解釋爲什麼他被擊中的jsp/index.jsf?
因爲我想,當有人打foo.com
和www.foo.com
在Tomcat前面沒有Apache嗎? – fglez