Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2013-10-14 00:59:18 +0000
committerGreg Wilkins2013-10-14 00:59:18 +0000
commitad124b688826dae007055ad7a11cff552b4a30dd (patch)
tree9be25900239c8ad4ba00fe0ca1cdb1b64d52d250 /tests/test-webapps
parent33b10efcaa58071d58d4bde3d52c2aab647f403b (diff)
downloadorg.eclipse.jetty.project-ad124b688826dae007055ad7a11cff552b4a30dd.tar.gz
org.eclipse.jetty.project-ad124b688826dae007055ad7a11cff552b4a30dd.tar.xz
org.eclipse.jetty.project-ad124b688826dae007055ad7a11cff552b4a30dd.zip
419309 Added symlink checker to test webapp
Diffstat (limited to 'tests/test-webapps')
-rw-r--r--tests/test-webapps/test-jetty-webapp/src/main/config/webapps.demo/test.xml5
-rw-r--r--tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java13
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/webapps.demo/test.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/webapps.demo/test.xml
index 423477a2d9..8cee715e54 100644
--- a/tests/test-webapps/test-jetty-webapp/src/main/config/webapps.demo/test.xml
+++ b/tests/test-webapps/test-jetty-webapp/src/main/config/webapps.demo/test.xml
@@ -29,6 +29,11 @@ detected.
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
<Set name="overrideDescriptor"><Property name="jetty.webapps" default="."/>/test.d/override-web.xml</Set>
+ <!-- Enable symlinks
+ <Call name="addAliasCheck">
+ <Arg><New class="org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker"/></Arg>
+ </Call>
+ -->
<!-- virtual hosts
<Set name="virtualHosts">
diff --git a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java
index 326015ba64..604a5f6647 100644
--- a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java
+++ b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java
@@ -669,6 +669,11 @@ public class Dump extends HttpServlet
catch(Exception e) {pout.write("<td>"+"" +e+"</td>");}
pout.write("</tr><tr>\n");
+ pout.write("<th align=\"right\">getServletContext().getRealPath(...):&nbsp;</th>");
+ try{pout.write("<td>"+getServletContext().getRealPath(res)+"</td>");}
+ catch(Exception e) {pout.write("<td>"+"" +e+"</td>");}
+
+ pout.write("</tr><tr>\n");
pout.write("<th align=\"right\">getServletContext().getContext(...):&nbsp;</th>");
ServletContext context = getServletContext().getContext(res);
@@ -690,8 +695,12 @@ public class Dump extends HttpServlet
if (cp==null || "/".equals(cp))
cp="";
pout.write("</tr><tr>\n");
- pout.write("<th align=\"right\">getServletContext().getContext(...),getRequestDispatcher(...):&nbsp;</th>");
- pout.write("<td>"+getServletContext().getContext(res).getRequestDispatcher(res.substring(cp.length()))+"</td>");
+ pout.write("<th align=\"right\">getServletContext().getContext(...).getRequestDispatcher(...):&nbsp;</th>");
+ pout.write("<td>"+context.getRequestDispatcher(res.substring(cp.length()))+"</td>");
+
+ pout.write("</tr><tr>\n");
+ pout.write("<th align=\"right\">getServletContext().getContext(...).getRealPath(...):&nbsp;</th>");
+ pout.write("<td>"+context.getRealPath(res.substring(cp.length()))+"</td>");
}
pout.write("</tr><tr>\n");

Back to the top