Reputation: 113
I have a HTML page that allows me to use JSP code. I was able to print some output using some basic Java. But How do I obtain a HttpServletRequest object so I can print some of its properties onto the HTML page?
Upvotes: 4
Views: 14469
Reputation: 25950
Just use the request
variable (HttpServletRequest
instance). It is one of implicit objects in JSP. Check properties here: http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html
<%
request.getHeader();
%>
Upvotes: 4