projects.jspf revision 1141
606N/ASee LICENSE.txt included in this distribution for the specific
606N/Afile and include the License file at LICENSE.txt.
606N/A--%><%@ page import="org.opensolaris.opengrok.configuration.*,
705N/AString context = request.getContextPath();
879N/ARuntimeEnvironment env = RuntimeEnvironment.getInstance();
879N/Aenv.setUrlPrefix(context + "/s?");
705N/Aif (env.hasProjects()) {
705N/A projects = env.getProjects();
705N/A String pr[] = request.getParameterValues("project");
705N/A // code bellow will accept more parameters project= and their format is either one by one, or separated by "," in one parameter
705N/A if (Project.getByDescription(p[idx]) != null) {
705N/A project.add(p[idx]);
879N/A Cookie[] cookies = request.getCookies();
705N/A if (cookie.getName().equals("OpenGrokProject")) {
705N/A for (String proj : cookie.getValue().split(",")) {
705N/A if (Project.getByDescription(proj) != null) {
705N/A project.add(proj);
705N/A Project defaultProject = env.getDefaultProject();
705N/A if (defaultProject != null && project.isEmpty()) {
705N/A Cookie cookie = new Cookie("OpenGrokProject", sproject.toString());
705N/A response.addCookie(cookie);