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

Last change on this file since 1048 was 1048, checked in by Nicklas Nordborg, 13 years ago

Fixes #213: Cannot save MeV options

It was caused by #203 and never happened in a released version.

  • 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
25  pageEncoding="UTF-8"
26  session="false"
27  import="net.sf.basedb.core.Application"
28  import="net.sf.basedb.core.SessionControl"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.User"
31  import="net.sf.basedb.clients.web.Base"
32  import="net.sf.basedb.clients.web.WebException"
33  import="net.sf.basedb.clients.web.util.HTML"
34  import="net.sf.basedb.util.Values"
35%>
36<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
37<%
38SessionControl sc = Base.getExistingSessionControl(pageContext, true);
39String ID = sc.getId();
40String cmd = request.getParameter("cmd");
41String root = request.getContextPath()+"/";
42
43String redirect = null;
44String message = null;
45
46try
47{
48  if ("SaveOptions".equals(cmd))
49  {
50    int maxMemory = Values.getInt(request.getParameter("maxMemory"), 512);
51    String mm = maxMemory == 512 ? null : Integer.toString(maxMemory);
52    sc.setUserClientSetting("net.sf.basedb.mev.launchmev.jvm.maxmemory", mm); 
53    message = "Settings saved";
54  }
55  else
56  {
57    throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd);
58  }
59}
60finally
61{}
62if (message == null)
63{
64  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&wait=0");
65}
66else
67{
68  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=0&message="+HTML.urlEncode(message));
69}
70%>
71
Note: See TracBrowser for help on using the repository browser.