source: extensions/net.sf.basedb.mev/trunk/resources/submit.jsp @ 978

Last change on this file since 978 was 978, checked in by Nicklas Nordborg, 14 years ago

Fixes #179: Add user-configurable option for JVM max memory

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 2.2 KB
Line 
1<%-- $Id $
2  ------------------------------------------------------------------
3  Copyright (C) 2009 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE 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  BASE 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
22  @author Nicklas
23--%>
24<%@ page session="false"
25  import="net.sf.basedb.core.Application"
26  import="net.sf.basedb.core.SessionControl"
27  import="net.sf.basedb.core.DbControl"
28  import="net.sf.basedb.core.User"
29  import="net.sf.basedb.clients.web.Base"
30  import="net.sf.basedb.clients.web.WebException"
31  import="net.sf.basedb.clients.web.util.HTML"
32  import="net.sf.basedb.util.Values"
33%>
34<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
35<%
36SessionControl sc = Base.getExistingSessionControl(pageContext, true);
37String ID = sc.getId();
38String cmd = request.getParameter("cmd");
39String root = request.getContextPath()+"/";
40
41String redirect = null;
42String message = null;
43
44try
45{
46  if ("SaveOptions".equals(cmd))
47  {
48    int maxMemory = Values.getInt(request.getParameter("maxMemory"), 512);
49    String mm = maxMemory == 512 ? null : Integer.toString(maxMemory);
50    sc.setUserClientSetting("net.sf.basedb.mev.launchmev.jvm.maxmemory", mm); 
51    message = "Settings saved";
52  }
53  else
54  {
55    throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd);
56  }
57}
58finally
59{}
60if (message == null)
61{
62  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&wait=0");
63}
64else
65{
66  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&message="+HTML.urlEncode(message));
67}
68%>
69
Note: See TracBrowser for help on using the repository browser.