How to get an HttpServletRequest object when loading a JSP page?

I have an HTML page that allows me to use JSP code. I was able to print some output using some basic Java. But how to get an HttpServletRequest object so that I can print some of its properties on an HTML page?

+4
source share
1 answer

Just use the request variable (an instance of HttpServletRequest ). This is one of the implicit objects in the JSP. Check the properties here: http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html

 <% request.getHeader(); %> 
+3
source

Source: https://habr.com/ru/post/1447061/


All Articles