Package org.apache.solr.servlet
Class ServletUtils
java.lang.Object
org.apache.solr.servlet.ServletUtils
Various Util methods for interaction on servlet level, i.e. HttpServletRequest
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.servlet.http.HttpServletRequestcloseShield(jakarta.servlet.http.HttpServletRequest request) Wrap the request's input stream with a close shield.static jakarta.servlet.http.HttpServletResponsecloseShield(jakarta.servlet.http.HttpServletResponse response) Wrap the response's output stream with a close shield.static StringgetPathAfterContext(jakarta.servlet.http.HttpServletRequest request) Use this to get the full path after context path "/solr", which is a combination of servletPath and pathInfo.
-
Method Details
-
getPathAfterContext
Use this to get the full path after context path "/solr", which is a combination of servletPath and pathInfo.- Parameters:
request- the HttpServletRequest object- Returns:
- String with path starting with a "/", or empty string if no path
-
closeShield
public static jakarta.servlet.http.HttpServletRequest closeShield(jakarta.servlet.http.HttpServletRequest request) Wrap the request's input stream with a close shield.Only the container should ever actually close the servlet output stream. This method possibly should be turned into a servlet filter
- Parameters:
request- The request to wrap.- Returns:
- A request object with an
InputStreamthat will ignore calls to close.
-
closeShield
public static jakarta.servlet.http.HttpServletResponse closeShield(jakarta.servlet.http.HttpServletResponse response) Wrap the response's output stream with a close shield.Only the container should ever actually close the servlet request stream.
- Parameters:
response- The response to wrap.- Returns:
- A response object with an
OutputStreamthat will ignore calls to close.
-