If you are using Jetty, you will find that there is not very convenient not to have the default context. Therefore, you have to overcome the root context in jetty to use your own target context.
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Make https://server/ redirect to https://server/targetApp/ -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Call name="addContext">
<Arg>
<New class="org.mortbay.http.HttpContext">
<Set name="ContextPath">/</Set>
<Call name="addHandler">
<Arg>
<New class="org.mortbay.http.handler.ForwardHandler">
<Set name="RootForward">/targetApp</Set>
<Call name="addForward">
<Arg>/favicon.ico</Arg>
<Arg>/targetApp/images/favicon.ico</Arg>
</Call>
</New>
</Arg>
</Call>
<Call name="addHandler">
<Arg>
<New class="targetApp.server.util.jetty.RedirectHandler" />
</Arg>
</Call>
</New>
</Arg>
</Call>
public class RedirectHandler implements org.mortbay.http.HttpHandler
{
public void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse) throws HttpException, IOException
{
httpResponse.sendRedirect( "/targetApp" );
httpRequest.setHandled( true );
}
}
Subscribe to:
Post Comments (Atom)
Thumbs Up to GitHub Copilot and JetBrains Resharper
Having used AI tool GitHub Copilot since 08/16/2023, I’ve realized that learning GitHub Copilot is like learning a new framework or library ...
-
I like NLog because it is probably the easiest logging framework I used. By simply copying NLog.config file to the project and set the ...
-
Recently ran into OutOfMemoryException from a .NET 3.0 WCF web service whenever the w3wp.exe reaches ~1.395 GB memory. WCF web service is ho...
-
Mutable Mutable is the most common collection type in the .NET world. These are collections such as List ; that allow reading, as...
No comments:
Post a Comment