@WebServlet( urlPatterns ={"/player"}, name = "testServlet")public class testServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String name = "wb";
request.setAttribute("wb",name);
request.getRequestDispatcher("/welcome.jsp").forward(request,response);
} protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}<html><head>
<title>Title</title></head><body><%
String name = (String)request.getAttribute("wb");
System.out.println(name);%></body></html>最后得到的值為空,這是什么情況各位大神?
關于JSP中使用getAttribute的到servlet傳來的值為空的問題。求救啊
12345678_0001
2018-08-09 15:06:39