]> git.argeo.org Git - gpl/argeo-slc.git/blob - server/org.argeo.slc.siteserver/bundles/simple-webapp.war/hello-osgi-world.jsp
Simplify setup
[gpl/argeo-slc.git] / server / org.argeo.slc.siteserver / bundles / simple-webapp.war / hello-osgi-world.jsp
1 <%@ page info="a hello world example" %>
2 <%@ page import="java.util.*,java.text.*"%>
3
4 <html>
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7 <link rel="stylesheet" href="styles/springsource.css" type="text/css" />
8 <title>Hello OSGi World</title>
9 </head>
10
11 <body>
12 <div id="main_wrapper">
13 <h1>Hello <%=request.getRemoteAddr()%>, from OSGi World!</h1>
14 <p>This JSP page (if properly compiled), should display various information about the current HTTP session.
15
16 <h2>HTTP Session info</h2>
17
18 <%
19 Format formatter = DateFormat.getDateTimeInstance();
20 %>
21
22 <table>
23 <tr><td>Id: </td><td><%=session.getId()%></td></tr>
24 <tr><td>Creation Date:</td><td><%=formatter.format(new Date(session.getCreationTime()))%></td></tr>
25 <tr><td>MaxInactiveInterval:</td><td><%=session.getMaxInactiveInterval()%> sec </td></tr>
26 </table>
27 <h3>Session Attributes</h3>
28 <table>
29 <tr><th>Name</th><th>Value</th></tr>
30
31 <%
32 for (Enumeration attributeNames = session.getAttributeNames(); attributeNames.hasMoreElements();) {
33 String attributeName = (String) attributeNames.nextElement();
34 Object attributeValue = session.getAttribute(attributeName);
35 %>
36 <tr><td><%=attributeName%></td><td><%=attributeValue%></td></tr>
37
38 <%
39 }
40 %>
41 </table>
42
43 <table class="footer">
44 <tr>
45 <td><a href="./">Home</a></td>
46 <td align="right"><img src="./images/springsource-logo.png"/></td>
47 </tr>
48 </table>
49
50 </div>
51 </body>
52 </html>