How to know which page is responding to the JSP request

Asked

Viewed 613 times

3

I have several pages JSP , and treat them all in mine servlet Control. I wonder if you have how to identify which page is being displayed so I can do all treatments , requests and responses, specific to this page. Could someone help me?

  • You can in JSP return a variable with its own name. Vc ta using some framework? Spring maybe? By the way, is there any implication that prevents you from having multiple Rvlets? In vdd it seems the most appropriate solution, no?

  • I have no problem having several Rvlets. I would like to do everything in one Rvlet only, but I see no problem.

  • Could you specify what kind of treatment exactly you want to do? Would you check the accessed URL? If so, I strongly advise against reinventing the wheel and using a framework like Spring MVC. You can map a URL to a method simply with an annotation. I have a complete sample project, see here.

1 answer

2

You can try using the return method HttpServletRequest.getRequestURI().

Browser other questions tagged

You are not signed in. Login or sign up in order to post.