Fix Tomcat rendering issues and redirect

This commit is contained in:
Sean Owen 2014-09-11 12:32:24 +01:00
parent 2d280f7b14
commit 53d562f7c9
3 changed files with 7 additions and 8 deletions

View file

@ -83,7 +83,7 @@ import javax.servlet.http.Part;
maxFileSize = 10_000_000,
maxRequestSize = 10_000_000,
fileSizeThreshold = 1_000_000,
location = "/tmp/DecodeServlet")
location = "/tmp")
@WebServlet("/w/decode")
public final class DecodeServlet extends HttpServlet {

View file

@ -45,9 +45,8 @@ public final class RedirectFilter implements Filter {
FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
String requestURI = request.getRequestURI();
if ("/index.jspx".equals(requestURI) ||
"/w/".equals(requestURI) ||
"/w/index.jspx".equals(requestURI)) {
if ("/".equals(requestURI) || "/index.jspx".equals(requestURI) ||
"/w/".equals(requestURI) || "/w/index.jspx".equals(requestURI)) {
redirect(servletResponse, "/w/decode.jspx");
} else if (requestURI.startsWith(OLD_JAVADOC_PREFIX)) {
String withoutPrefix = requestURI.substring(OLD_JAVADOC_PREFIX.length());

View file

@ -14,19 +14,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.1">
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1">
<jsp:directive.page contentType="text/html" session="false"/>
<jsp:text><![CDATA[<!DOCTYPE html>]]></jsp:text>
<html>
<head>
<meta charset="UTF-8"/>
<title><c:out value="${requestScope['title']}"/></title>
<title>${requestScope['title']}</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<div id="main">
<div id="header"><h1><img src="zxing-icon.png" id="icon" alt=""/>&amp;nbsp;<c:out value="${requestScope['title']}"/></h1></div>
<p><c:out value="${requestScope['text']}"/></p>
<div id="header"><h1><img src="zxing-icon.png" id="icon" alt=""/>&amp;nbsp;${requestScope['title']}</h1></div>
<p>${requestScope['text']}</p>
</div>
</body>
</html>