jsp得到登陆前的url

       <%
           String currentURI=request.getRequestURI();
           String targetURL = currentURI.substring(currentURI.lastIndexOf("/")+1, currentURI.length());
           int falg=0;
           // 处理所有参数
           java.util.Enumeration e = request.getParameterNames();
           while(e.hasMoreElements()){
               String paramName = (String)e.nextElement();
               String paramValue = (String)request.getParameter(paramName);
               if(falg==0) {
                    targetURL += ("?"+paramName+"="+paramValue);
                    falg++;
               }
               else{
               targetURL += ("&"+paramName+"="+paramValue);
              }
           }
       %>

你可能感兴趣的:(java,jsp)