439387 Ensure empty servlet-class never generated for quickstart

This commit is contained in:
Jan Bartel 2014-07-11 14:16:24 +10:00
parent c674c41003
commit 644eccab8b
3 changed files with 9 additions and 17 deletions

View File

@ -567,8 +567,9 @@ public class QuickStartDescriptorGenerator
out.tag(tag + "-name",n);
String ot = n + "." + tag + ".";
out.tag(tag + "-class",origin(md,ot + tag + "-class"),holder.getClassName());
if (holder instanceof FilterHolder)
out.tag(tag + "-class",origin(md,ot + tag + "-class"),holder.getClassName());
for (String p : holder.getInitParameters().keySet())
{
@ -583,8 +584,10 @@ public class QuickStartDescriptorGenerator
if (holder instanceof ServletHolder)
{
ServletHolder s = (ServletHolder)holder;
if (s.getForcedPath() != null)
if (s.getForcedPath() != null && s.getClassName() == null)
out.tag("jsp-file",s.getForcedPath());
else
out.tag(tag + "-class",origin(md,ot + tag + "-class"),s.getClassName());
if (s.getInitOrder() != 0)
out.tag("load-on-startup",Integer.toString(s.getInitOrder()));

View File

@ -849,18 +849,6 @@ public class ServletHandler extends ScopedHandler
{
try
{
/* if (servlet.getClassName() == null && servlet.getForcedPath() != null)
{
ServletHolder forced_holder = _servletPathMap.match(servlet.getForcedPath());
if (forced_holder == null || forced_holder.getClassName() == null)
{
mx.add(new IllegalStateException("No forced path servlet for " + servlet.getForcedPath()));
continue;
}
System.err.println("ServletHandler setting forced path classname to "+forced_holder.getClassName()+ " for "+servlet.getForcedPath());
servlet.setClassName(forced_holder.getClassName());
}*/
servlet.start();
servlet.initialize();
}

View File

@ -283,10 +283,11 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
}
String servlet_class = node.getString("servlet-class", false, true);
if ("".equals(servlet_class))
servlet_class = null;
//Handle the default jsp servlet instance
if (id != null && id.equals("jsp"))
if (id != null && id.equals("jsp") && servlet_class != null)
{
try
{