0
這是我的測試servlet;EL表達未評估
public class EventListServlet extends javax.servlet.http.HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
process(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
process(request, response);
}
private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setAttribute("name", "test1");
request.getRequestDispatcher("index.jsp").forward(request, response);
}
}
and test jsp;
<html>
<body>
<h2>Hello World!</h2>
<p>${name}</p>
</body>
</html>
,輸出爲$ {name}的
應該寫測試1:/這有什麼錯在於:
我只是說,但現在的結果是公平的。你好,世界! – cem
所以你看到了改變我的行爲?這是一個開始...... – EJK
你是否100%確定你的servlet代碼正在執行? – EJK