这根本不对。。。您正在做这件事。。。在此之前,您必须阅读servlet jsp。
为您的项目创建一个servlet,并将数据从servlet传递到jsp,然后只有jsp可以从那里访问数据
首先尝试servlet jsp示例。
public class Login extends HttpServlet { private static final long serialVersionUID = 1L; public Login() { super(); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {//right your pre here to get data from jstlClass and pass it to the jsp in request request.setAttribute("",""); request.getRequestDispatcher("/FirstJSP.jsp").forward(request, response); }protected void doget(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } } }}
然后您可以在那里访问参数
试试这个例子 http://www.java-
samples.com/showtutorial.php?tutorialid=552
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)