I have x.jsp that can either be served as the whole response, or being included in several other jsp files.
So how can I know inside x.jsp if it is being included by another file or not?
You can check the value of the attribute javax.servlet.include.request_uri in your x.jsp page. If set, the jsp page was included.
Further details here: Java HttpServletRequest get URL in browsers URL bar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With