Servlet内部参数传递

greetingServlet

String username=request.getParameter("username");

RequestDispatcher dispatcher=getServletContext().getResponseDisptcher("路径") ;

responseServlet

PrintWriter out=response.getWriter();

String username=request.getParameter("username");

if (username!=""&&username.length!=0){

out.print( username);

}

你可能感兴趣的:(servlet)