为什么jsp request.getParameter取不到值,但request.getQueryString()却有值呢
servrlt:publicclassStudentLoginSvltextendsHttpServlet{publicvoiddoGet(HttpServletRequ...
servrlt:
public class StudentLoginSvlt extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
{
res.sendRedirect("jsp/DisplayCourse.jsp?username=wgy&ww=eee");
}
}
DisplayCourse.jsp:
request.getQueryString() 得到值为:username=wgy&ww=eee;
request.getParameter("username”)为空 展开
public class StudentLoginSvlt extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
{
res.sendRedirect("jsp/DisplayCourse.jsp?username=wgy&ww=eee");
}
}
DisplayCourse.jsp:
request.getQueryString() 得到值为:username=wgy&ww=eee;
request.getParameter("username”)为空 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询