xref: /OpenGrok/opengrok-web/src/main/webapp/projects.jspf (revision 0d40e9d0d07acb46ebe450cbc6042a9705a36e41)
1*0d40e9d0SAdam Hornáček<%--
2*0d40e9d0SAdam Hornáček$Id$
3*0d40e9d0SAdam Hornáček
4*0d40e9d0SAdam HornáčekCDDL HEADER START
5*0d40e9d0SAdam Hornáček
6*0d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the
7*0d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License").
8*0d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License.
9*0d40e9d0SAdam Hornáček
10*0d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific
11*0d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License.
12*0d40e9d0SAdam Hornáček
13*0d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each
14*0d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt.
15*0d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the
16*0d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying
17*0d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner]
18*0d40e9d0SAdam Hornáček
19*0d40e9d0SAdam HornáčekCDDL HEADER END
20*0d40e9d0SAdam Hornáček
21*0d40e9d0SAdam HornáčekCopyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
22*0d40e9d0SAdam Hornáček
23*0d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner.
24*0d40e9d0SAdam Hornáček
25*0d40e9d0SAdam Hornáček--%>
26*0d40e9d0SAdam Hornáček<%@page import="
27*0d40e9d0SAdam Hornáčekjava.net.URLEncoder,
28*0d40e9d0SAdam Hornáčekjava.util.TreeSet,
29*0d40e9d0SAdam Hornáček
30*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.web.Prefix,
31*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.web.PageConfig,
32*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.configuration.Project
33*0d40e9d0SAdam Hornáček"%><%
34*0d40e9d0SAdam Hornáček/* ---------------------- projects.jspf start --------------------- */
35*0d40e9d0SAdam Hornáček{
36*0d40e9d0SAdam Hornáček    // Use UTF-8 if no encoding is specified in the request
37*0d40e9d0SAdam Hornáček    if (request.getCharacterEncoding() == null) {
38*0d40e9d0SAdam Hornáček        request.setCharacterEncoding("UTF-8");
39*0d40e9d0SAdam Hornáček    }
40*0d40e9d0SAdam Hornáček
41*0d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
42*0d40e9d0SAdam Hornáček    cfg.getEnv().setUrlPrefix(request.getContextPath() + Prefix.SEARCH_R + "?");
43*0d40e9d0SAdam Hornáček
44*0d40e9d0SAdam Hornáček    String projects = cfg.getRequestedProjectsAsString();
45*0d40e9d0SAdam Hornáček    if (projects.length() != 0) {
46*0d40e9d0SAdam Hornáček        Cookie cookie = new Cookie(PageConfig.OPEN_GROK_PROJECT, URLEncoder.encode(projects, "utf-8"));
47*0d40e9d0SAdam Hornáček        response.addCookie(cookie);
48*0d40e9d0SAdam Hornáček    }
49*0d40e9d0SAdam Hornáček}
50*0d40e9d0SAdam Hornáček/* ---------------------- projects.jspf end --------------------- */
51*0d40e9d0SAdam Hornáček%>