java - Is it possible to map a servlet to /* without overriding JSP processing -


elaborating on this:

i map servlet or filter "/*"

now, if access url like:

/test 

then directed servlet (which okay)

but if access url like:

/index.jsp 

this directed servlet, dont want behavior, want index.jsp processed jsp.

how can done?

map controller servlet on more specific url-pattern /controller/* , create filter mapped on /* , follows in dofilter() method.

string uri = ((httpservletrequest) request).getrequesturi(); if (uri.endswith(".jsp")) {     chain.dofilter(request, response); // let go. container's builtin jspservlet pickup this. } else {     request.getrequestdispatcher("/controller" + uri).forward(request, response); // goes controller servlet. } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -