%
/*******************************************************************************
* Copyright (c) 2001, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* 20100414 306773 mahutch@ca.ibm.com - Mark Hutchinson, make session time out configurable
*******************************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8" import="org.eclipse.wst.ws.internal.explorer.platform.perspective.*,
org.eclipse.wst.ws.internal.explorer.platform.constants.*,
org.eclipse.wst.ws.internal.explorer.*,
org.eclipse.wst.ws.internal.explorer.platform.util.URLUtils,
java.util.Enumeration,
java.net.*,
java.io.*"%>
<%
String sessionId = session.getId();
%>
<%!
private void resetController(ServletContext application,String sessionId,HttpSession session,HttpServletRequest request,Controller controller){
// Add the session to the application. This allows us to resurrect the session even if the browser chooses not to participate.
application.setAttribute(sessionId,session);
// Set Max inactivity time out value to 30mins.
session.setMaxInactiveInterval(controller.getSessionTimeoutInMinutes() * 60);
// LaunchOptionManager (below) handles most options,
// but need to get state and install locations earlier,
// specifically before controller.init().
Enumeration paramNames = request.getParameterNames();
while (paramNames.hasMoreElements())
{
String paramName = (String)paramNames.nextElement();
String[] paramValues = request.getParameterValues(paramName);
if (paramValues != null && paramValues.length > 0)
{
String decodedParamName = URLUtils.decode(paramName);
if (decodedParamName.equals(LaunchOptions.DEFAULT_FAVORITES_LOCATION))
{
controller.setDefaultFavoritesLocation(paramValues[0]);
}
else if (decodedParamName.equals(LaunchOptions.STATE_LOCATION))
{
controller.setStateLocation(paramValues[0]);
}
}
}
// controller.init()
controller.init(sessionId,application,request.getContextPath());
}
%>
<%//resetController(application,sessionId,session,request,controller);%>
<%
// Check if session Controller needs to be re-initialized
if (controller.getSessionId()==null){
resetController(application,sessionId,session,request,controller);
}
// preload from LaunchOptionManager
String key = request.getParameter(URLUtils.encode(WSExplorerContext.ID));
if (key != null && key.length() > 0)
{
LaunchOptionsManager manager = LaunchOptionsManager.getInstance();
manager.manage(key, sessionId, application);
}
%>
<%=controller.getMessage("TITLE_WSEXPLORER")%>
<%
// reset perspective content to blank
controller.enablePerspectiveContentBlank(true);
%>