1. 程式人生 > >解決測試環境和生產環境頁面路徑不匹配的辦法

解決測試環境和生產環境頁面路徑不匹配的辦法

實際應用中,一般用來解決jsp測試和生產環境路徑不同的問題: 

<%
 String appContext = request.getContextPath();
 String basePath = request.getScheme()+"://"+request.getServerName()+":"+ request.getServerPort() + appContext; 
%>