web applications - In a Java-webapp (war), how can I use HTTP-auth for static content? -
I have a Java-WebEp webpage that is packaged as a war-file. These war files allow static content I can make an HTTP-authentication (implementing it with servlet) for servlets in this war, which is delivered directly via HTTP. But I also want HTTP-authentication for static content. How can I know this?
Create a class that implements javax.servlet.Filter. See
The main method is doFilter which has passed the ServletRequest, ServletResponse and FilterChain objects. It happens when you apply authentication.
Then declare your filter and a filter mapping in web.xml (Maps for each request)
Comments
Post a Comment