我有一个像这样编码的现有 JSP。
<%
if( (request.getParameter("userid")!=null) && (request.getParameter("token")!=null) ) {
session.setParameter("USERID", request.getParameter(userid);
session.setParameter("Token", request.getParameter(token);
send.redirect(another.jsp);
}
%>
< ----- here i have the normal HTML contents where i ask for userid from the user
and upon clicking submit, java script function openwindow() is called ----- >
function openwindow(){
< -- here i open a modal window which calls a URL with userid (get method)
and as return value i get userid and token back.
Now i set this to document.Parent.userid and document.Parent.token --- >
document.Parent.userid = retval.userid;
document.Parent.token = retval.token;
Parent.submit();
}
使用上面提到的JSP,我遇到了一个问题,当我使用 调用JSP时,由于设置了请求参数sample.jsp?userid=dhfgd&token=dhdhd
,因此控件直接进入。another.jsp
为避免这种情况,请建议我一个可能的解决方案,而无需对代码进行太多更改。