1 | <%-- |
---|
2 | Copyright (C) 2011 Nicklas Nordborg |
---|
3 | |
---|
4 | This file is part of the Example Code Package for BASE. |
---|
5 | Available at http://baseplugins.thep.lu.se/ |
---|
6 | BASE main site: http://base.thep.lu.se/ |
---|
7 | |
---|
8 | This is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License |
---|
10 | as published by the Free Software Foundation; either version 3 |
---|
11 | of the License, or (at your option) any later version. |
---|
12 | |
---|
13 | The software is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | GNU General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | --%> |
---|
21 | <%@ page |
---|
22 | pageEncoding="UTF-8" |
---|
23 | session="false" |
---|
24 | import="net.sf.basedb.core.SessionControl" |
---|
25 | import="net.sf.basedb.core.DbControl" |
---|
26 | import="net.sf.basedb.core.User" |
---|
27 | import="net.sf.basedb.clients.web.Base" |
---|
28 | import="net.sf.basedb.clients.web.util.HTML" |
---|
29 | %> |
---|
30 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
31 | <% |
---|
32 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
33 | final String ID = sc.getId(); |
---|
34 | final DbControl dc = sc.newDbControl(); |
---|
35 | |
---|
36 | try |
---|
37 | { |
---|
38 | User current = User.getById(dc, sc.getLoggedInUserId()); |
---|
39 | %> |
---|
40 | <base:page type="popup" title="Hello JSP world"> |
---|
41 | <base:head /> |
---|
42 | <base:body> |
---|
43 | <h1>Hello <%=HTML.encodeTags(current.getName())%></h1> |
---|
44 | <div class="content bottomborder"> |
---|
45 | <table class="fullform"> |
---|
46 | <tr> |
---|
47 | <th>Session ID</th> |
---|
48 | <td><%=ID%></td> |
---|
49 | </tr> |
---|
50 | <tr> |
---|
51 | <th>Login</th> |
---|
52 | <td><%=HTML.encodeTags(current.getLogin())%></td> |
---|
53 | </tr> |
---|
54 | <tr class="dynamic"> |
---|
55 | <th>Email</th> |
---|
56 | <td><%=HTML.niceFormat(current.getEmail())%></td> |
---|
57 | </tr> |
---|
58 | </table> |
---|
59 | </div> |
---|
60 | |
---|
61 | <base:buttongroup subclass="dialogbuttons"> |
---|
62 | <base:button onclick="window.close()" title="Close" /> |
---|
63 | </base:buttongroup> |
---|
64 | |
---|
65 | </base:body> |
---|
66 | </base:page> |
---|
67 | <% |
---|
68 | } |
---|
69 | finally |
---|
70 | { |
---|
71 | if (dc != null) dc.close(); |
---|
72 | } |
---|
73 | %> |
---|