419309 Added symlink checker to test webapp
This commit is contained in:
parent
33b10efcaa
commit
ad124b6888
|
@ -1723,6 +1723,16 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
|
|||
return _aliasChecks;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @param checks list of AliasCheck instances
|
||||
*/
|
||||
public void setAliasChecks(List<AliasCheck> checks)
|
||||
{
|
||||
_aliasChecks.clear();
|
||||
_aliasChecks.addAll(checks);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* Context.
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -668,6 +668,11 @@ public class Dump extends HttpServlet
|
|||
try{pout.write("<td>"+getServletContext().getResourcePaths(res)+"</td>");}
|
||||
catch(Exception e) {pout.write("<td>"+"" +e+"</td>");}
|
||||
|
||||
pout.write("</tr><tr>\n");
|
||||
pout.write("<th align=\"right\">getServletContext().getRealPath(...): </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(...): </th>");
|
||||
|
||||
|
@ -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(...): </th>");
|
||||
pout.write("<td>"+getServletContext().getContext(res).getRequestDispatcher(res.substring(cp.length()))+"</td>");
|
||||
pout.write("<th align=\"right\">getServletContext().getContext(...).getRequestDispatcher(...): </th>");
|
||||
pout.write("<td>"+context.getRequestDispatcher(res.substring(cp.length()))+"</td>");
|
||||
|
||||
pout.write("</tr><tr>\n");
|
||||
pout.write("<th align=\"right\">getServletContext().getContext(...).getRealPath(...): </th>");
|
||||
pout.write("<td>"+context.getRealPath(res.substring(cp.length()))+"</td>");
|
||||
}
|
||||
|
||||
pout.write("</tr><tr>\n");
|
||||
|
|
Loading…
Reference in New Issue