Link does not send parameters and redirects to Servlet

5

I placed in my index page where I have three links one with the name of T-shirts, Bermudas and Pants in which% I put% so that when I clicked the link it was redirected to the servlet and sent the parameters according to the link, but that does not happen.

JSP Page

<%
  String camisetas="Camisetas";
  String bermudas="Bermudas";
  String calcas="Calças";
%>

<div class="dropdown-content3">

 <li><a href="ListarProdutosPaginada?tipo=${camisetas}">Camisetas</a></li>
 <li><a href="ListarProdutosPaginada?tipo=${bermudas}"> Bermudas</a></li>
 <li><a href="ListarProdutosPaginada?tipo=${calcas}">Calças</a></li>
                      

</div>
    
asked by anonymous 01.11.2017 / 20:48

1 answer

1

Your urls are incomplete. It would have to be something like this:

<li>
 <a href="http://localhost:8080/app/ListarProdutosPaginada?tipo=${camisetas}">Camisetas</a>
</li>

Instead of 'app' put the context you're using in your application. If you're not using one, leave it alone.

    
01.11.2017 / 21:08