I'm doing a web application with JavaEE and I need to pass certain parameters from a Servlet to a Jsp, I do it like this:
request.setAttribute("car", per.getCarrera().getNombre());
And for the redirection:
request.getRequestDispatcher("/odontologia/Tratamiento.jsp").forward(request,response);
The problem is that doing it in this way does not recognize the links to Javascript files that are on the JSP page, they are declared as follows:
<script src="../assets/js/plugins.js"></script>
I have also tried with Absolute routes but it still does not link the .js
<script src="<%=request.getContextPath()%>/assets/js/plugins.js"></script>
If the redirection was done with:
response.sendRedirect();
I recognize the .js files but I can not send the parameters. Any way to do this without using the session? and another question On what occasions is it correct to use the session to pass the variables from the Servlet to Jsp?