-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateprofile.jsp
More file actions
59 lines (55 loc) · 1.73 KB
/
createprofile.jsp
File metadata and controls
59 lines (55 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<%@include file="util.jsp"%>
<%@include file="logincheck.jsp" %>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${not empty param.shortname and not empty param.longname}">
<%
try {
Properties properties = new Properties();
properties.setProperty("name", request.getParameter("shortname"));
properties.setProperty("longname", request.getParameter("longname"));
getStore(application).storeProfile(properties);
request.getSession().setAttribute("group", request.getParameter("shortname"));
response.sendRedirect("showprofile.jsp?operation=editprofile&name=" + request.getParameter("shortname"));
} catch (Exception e) {%>
<html>
<body>
<%
out.println(e.getMessage());
out.println("<br>");
java.io.PrintWriter pw = new java.io.PrintWriter(out);
e.printStackTrace(pw);
%>
</body>
</html>
<%
}
%>
</c:if>
<html>
<body>
<table width="100%">
<tr height="300">
<td height="100%" align="center" valign="middle">
<form method="GET" action="createprofile.jsp">
<table>
<tr>
<td class="default">profilnamn (endast a-z,0-9):</td>
<td><input name="shortname"/></td>
</tr>
<tr>
<td class="default">långt namn:</td>
<td><input name="longname"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="skapa profil"/></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>