source: extensions/net.sf.basedb.mev/tags/1.8/resources/submit.jsp @ 1444

Last change on this file since 1444 was 1416, checked in by Nicklas Nordborg, 12 years ago

Fixes #328: Switch to GPL3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 2.3 KB
Line 
1<%-- $Id $
2  ------------------------------------------------------------------
3  Copyright (C) 2009 Nicklas Nordborg
4
5  This file is part of the MeV Launcher extension for BASE.
6  Available at http://baseplugins.thep.lu.se/
7  BASE main site: http://base.thep.lu.se/
8  -----------------------------------------------------------
9 
10  This is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License
12  as published by the Free Software Foundation; either version 3
13  of the License, or (at your option) any later version.
14 
15  The software is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with BASE. If not, see <http://www.gnu.org/licenses/>.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25--%>
26<%@ page
27  pageEncoding="UTF-8"
28  session="false"
29  import="net.sf.basedb.core.Application"
30  import="net.sf.basedb.core.SessionControl"
31  import="net.sf.basedb.core.DbControl"
32  import="net.sf.basedb.core.User"
33  import="net.sf.basedb.clients.web.Base"
34  import="net.sf.basedb.clients.web.WebException"
35  import="net.sf.basedb.clients.web.util.HTML"
36  import="net.sf.basedb.util.Values"
37%>
38<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
39<%
40SessionControl sc = Base.getExistingSessionControl(pageContext, true);
41String ID = sc.getId();
42String cmd = request.getParameter("cmd");
43String root = request.getContextPath()+"/";
44
45String redirect = null;
46String message = null;
47
48try
49{
50  if ("SaveOptions".equals(cmd))
51  {
52    int maxMemory = Values.getInt(request.getParameter("maxMemory"), 512);
53    String mm = maxMemory == 512 ? null : Integer.toString(maxMemory);
54    sc.setUserClientSetting("net.sf.basedb.mev.launchmev.jvm.maxmemory", mm); 
55    message = "Settings saved";
56  }
57  else
58  {
59    throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd);
60  }
61}
62finally
63{}
64if (message == null)
65{
66  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&wait=0");
67}
68else
69{
70  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&message="+HTML.urlEncode(message));
71}
72%>
73
Note: See TracBrowser for help on using the repository browser.