private Context addWebapp(final Host host, final String url, final String name, 
final String path, final PluginDescriptor pluginDescriptor, final 
AddContextListener contextAddListened) { silence(host, url); final 
PluginManager manager = PluginManager.lookup(getClass().getClassLoader()); 
final Context ctx = new StandardContext(); ctx.setName(name); ctx.setPath(url); 
ctx.setDocBase(path); ctx.setParentClassLoader( 
manager.getPluginClassLoader(pluginDescriptor)); //ctx.setLoader(); // 
disabling standard WebSockets service initializer to use it manually later on 
ctx.setContainerSciFilter(Pattern.quote(WsSci.class.getName())); final 
PluginJarScanner jarScanner = new PluginJarScanner(); 
jarScanner.setPlugin(pluginDescriptor); jarScanner.setScanClassPath(false); 
ctx.setJarScanner(jarScanner); ctx.addLifecycleListener(new WebXmlListener()); 
final ContextConfig ctxCfg = new ContextConfig(); 
ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one 
- it'll have dup error ) ctxCfg.setDefaultWebXml(tomcat.noDefaultWebXmlPath()); 
if (contextAddListened != null) { contextAddListened.beforeAdd(ctx); } if (host 
== null) { tomcat.getHost().addChild(ctx); } else { host.addChild(ctx); } if 
(contextAddListened != null) { contextAddListened.afterAdd(ctx); } return ctx; 
} public static class WebXmlListener extends DefaultWebXmlListener { @Override 
public void lifecycleEvent(final LifecycleEvent event) { 
super.lifecycleEvent(event); if 
(Lifecycle.BEFORE_START_EVENT.equals(event.getType())) { final Context ctx = 
(Context) event.getLifecycle(); final Wrapper servlet = (Wrapper) 
ctx.findChild("jsp"); servlet.addInitParameter("compilerSourceVM", "1.8"); 
servlet.addInitParameter("compilerTargetVM", "1.8"); } } } Structure to 
resource : webapps -> lundase -> about -> aboutus -> index.html index.html: <%@ 
page session="false" pageEncoding="UTF-8" 
import="com.gridnine.platform.server.lundase.web.content.*" 
import="com.gridnine.platform.common.lundase.model.content.*" %><% MetaVO meta 
= SiteMetadataHelper.getStaticMeta(MainSitePage.ABOUT_HOME); %><jsp:include 
page="/source/frametemplates/master.jsp"> <jsp:param name="title" value="<%= 
meta.getTitle() %>"/> <jsp:param name="description" value="<%= 
meta.getDescription() %>"/> <jsp:param name="content" value="about-us.jsp"/> 
</jsp:include> Problems url localhost:9000/about/aboutus tomcat redirected to 
localhost:9000/lundase/about/aboutus/
20.12.2022, 15:11, Mark Thomas < mailto:ma...@apache.org ma...@apache.org >
You'll need to provide: - The httpd proxy configuration - the context path - 
the servlet mapping(s) - the code that generates the problematic link - the URL 
of the request that triggers the problem Mark On 20/12/2022 07:37, alik alikov 
wrote: > Hello I have some problems with trailing slashes. > When I try to get 
to the page for example: "about/page" tomcat understands that it is necessary 
to add a slash and adds it, however, he also adds the name of the root folder 
to this, that is, the url "lundase/about/page/" turns out, and any requests to 
our server via apache are proxied with the addition of "lundase", so it turns 
out that we are accessing the application on request 
"lundase/lundase/about/page/" which results in a 404 status. > I googled it and 
found two properties: > context.setMapperContextRootRedirectEnabled(false) 
context.setMapperDirectoryRedirectEnabled(false) > And tryed to play with them, 
however, it's not resolve my problem please can you help me with it? > . > 
--------------------------------------------------------------------- To 
unsubscribe, e-mail: /compose/ users-unsubscr...@tomcat.apache.org For 
additional commands, e-mail: /compose/ users-h...@tomcat.apache.org

Reply via email to