332907 link structure before adding beans to container

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3119 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2011-05-11 01:52:06 +00:00
parent 903d07a230
commit 9c9f151ff4
1 changed files with 6 additions and 3 deletions

View File

@ -116,21 +116,24 @@ public class ServletHandler extends ScopedHandler
*/
public void setServer(Server server)
{
if (getServer()!=null && getServer()!=server)
Server old=getServer();
if (old!=null && old!=server)
{
getServer().getContainer().update(this, _filters, null, "filter",true);
getServer().getContainer().update(this, _filterMappings, null, "filterMapping",true);
getServer().getContainer().update(this, _servlets, null, "servlet",true);
getServer().getContainer().update(this, _servletMappings, null, "servletMapping",true);
}
if (server!=null && getServer()!=server)
super.setServer(server);
if (server!=null && old!=server)
{
server.getContainer().update(this, null, _filters, "filter",true);
server.getContainer().update(this, null, _filterMappings, "filterMapping",true);
server.getContainer().update(this, null, _servlets, "servlet",true);
server.getContainer().update(this, null, _servletMappings, "servletMapping",true);
}
super.setServer(server);
}
/* ----------------------------------------------------------------- */