private Object getHttpLaunchable(IModuleArtifact moduleObject, ServerDelegate delegate) throws CoreException {
URL url = ((IURLProvider) delegate).getModuleRootURL(moduleObject.getModule());
try {
if (moduleObject instanceof Servlet) {
Servlet servlet = (Servlet) moduleObject;
if (servlet.getAlias() != null) {
String path = servlet.getAlias();
if (path.startsWith("/"))
path = path.substring(1);
url = new URL(url, path);
} else
url = new URL(url, "servlet/"
+ servlet.getServletClassName());
} else if (moduleObject instanceof WebResource) {
WebResource resource = (WebResource) moduleObject;
String path = resource.getPath().toString();
if (path != null && path.startsWith("/") && path.length() > 0)
path = path.substring(1);