%@page import="javax.naming.Context"%> <%@ page language="java" pageEncoding="UTF-8" %><% String uri = request.getParameter("uri"); if (uri == null) { uri = ""; } String searchTerm = request.getParameter("searchTerm"); if (searchTerm == null) { searchTerm = ""; } String location = request.getHeader("X-SERVLET-LOCATION"); if (location == null) { location = request.getContextPath(); } if (!request.getRequestURI().endsWith("/")) { StringBuilder sb = new StringBuilder(location); if (!location.endsWith("/")) { sb.append("/"); } response.sendRedirect(sb.toString()); } else { StringBuilder testUri = new StringBuilder(location); if (!location.endsWith("/")) { testUri.append("/"); } testUri.append("EndpointTester"); %>