<%@ page info="a hello world example" %> <%@ page import="java.util.*,java.text.*"%> Hello OSGi World

Hello <%=request.getRemoteAddr()%>, from OSGi World!

This JSP page (if properly compiled), should display various information about the current HTTP session.

HTTP Session info

<% Format formatter = DateFormat.getDateTimeInstance(); %>
Id: <%=session.getId()%>
Creation Date:<%=formatter.format(new Date(session.getCreationTime()))%>
MaxInactiveInterval:<%=session.getMaxInactiveInterval()%> sec

Session Attributes

<% for (Enumeration attributeNames = session.getAttributeNames(); attributeNames.hasMoreElements();) { String attributeName = (String) attributeNames.nextElement(); Object attributeValue = session.getAttribute(attributeName); %> <% } %>
NameValue
<%=attributeName%><%=attributeValue%>