I got a requirement to send one parameter through url pattern of servlet (like we send through <a href="example.jsp?id=1">send</a>
) in the same way I need it through url pattern.
I do this with other possibilities like
- I can send that parameter as hidden type
- i can put in a request and session objects
these methods are working fine no problem
but through url it's not taking? I want to know whether it is possible or not?
the code I have tried
jsp page
<a href="download?filename=<%=filename%>" target="_blank"> <font color="black"><%=filename%> </font></a>
servlet code
String filename=request.getParameter("filename");
and i need one answer can we pass parameter through url pattern if yes how? i.e like same as through <a href="example?id=1">send</a>
or differently?