How do you detect the URL in a Java Servlet when forwarding to JSP?

前端 未结 2 1089
难免孤独
难免孤独 2021-01-06 12:53

I have a servlet that looks something like this:

public class ExampleServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServ         


        
2条回答
  •  长发绾君心
    2021-01-06 13:48

    The question is vague and ambiguous (is the servlet calling itself on every forward again?), but it much sounds like that you need request.getAttribute("javax.servlet.forward.request_uri").

提交回复
热议问题