From: Vlad S. <vl...@us...> - 2005-04-29 21:24:06
|
Update of /cvsroot/jtidy/jtidyservlet-webapp/src/java/org/w3c/tidy/servlet/sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14217/src/java/org/w3c/tidy/servlet/sample Modified Files: DisplaySourceServlet.java Log Message: Struts and tiles tests. Index: DisplaySourceServlet.java =================================================================== RCS file: /cvsroot/jtidy/jtidyservlet-webapp/src/java/org/w3c/tidy/servlet/sample/DisplaySourceServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DisplaySourceServlet.java 1 Nov 2004 16:36:51 -0000 1.3 +++ DisplaySourceServlet.java 29 Apr 2005 21:23:58 -0000 1.4 @@ -114,14 +114,19 @@ { jspFile = "index.jsp"; } + else if (jspFile.lastIndexOf("/") == (jspFile.length() - 1)) + { + jspFile += "index.jsp"; + } + // only want to show sample pages, don't play with url! /* * if (!jspFile.startsWith("example-")) { throw new ServletException("Invalid file selected: " + jspFile); } */ - if ((jspFile.indexOf("..") >= 0) - || (jspFile.toUpperCase().indexOf("/WEB-INF/") >= 0) + if ((jspFile.indexOf("..") >= 0) + || (jspFile.toUpperCase().indexOf("/WEB-INF/") >= 0) || (jspFile.toUpperCase().indexOf("/META-INF/") >= 0)) { throw new ServletException("Invalid file selected: " + jspFile); |