EL JSP does not work

2

Servlet code:

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
{
    token = "teste";
    request.setAttribute("token", token);
    System.out.println(token);
    RequestDispatcher view = request.getRequestDispatcher("teste.jsp");
    view.forward(request, response);     
}

Excerpt that I want to print the parameter:

<p>Primeiro token adicionado é : $(requestScope.token) </p>

Instead of printing the content of the attribute it prints $(requestScope.token) .

    
asked by anonymous 15.12.2017 / 14:21

1 answer

4

You made the assignment to the value token :

request.setAttribute("token", token);

Have you tested with <p>Primeiro token adicionado é : ${token} </p> ?

Watch out for the use of {} .

link

    
15.12.2017 / 14:29