-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to set public urls on web.xml? #55
Labels
Comments
Did you figure this one out? Bring it up on the mailing list? |
Yes I did. I wrote a another filter that manages the public path. @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
String contextPath = ((HttpServletRequest) request).getContextPath();
String uri = ((HttpServletRequest) request).getRequestURI();
String url = uri.substring(contextPath.length());
if (isPulic(url)) {
log("public - " + url);
chain.doFilter(request, response);
}
else {
log("protected - " + url);
securityFilter.doFilter(request, response, chain); /*cat jump */
}
}
@Override
public void init(FilterConfig fConfig) throws ServletException {
this.filterConfig = fConfig;
this.publicPath = "^/(public|css|js|images|plugins).*";
if (this.publicPath != null && this.publicPath.length() > 0)
this.publicPathPattern = Pattern.compile(this.publicPath, Pattern.CASE_INSENSITIVE);
else
log("publicPath has to be set in web.xml");
this.securityFilter = new NegotiateSecurityFilter();
this.securityFilter.init(filterConfig);
} |
Thanks, I'll close this. I'd appreciate an FAQ entry maybe on this if you have a moment to contribute one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've got a SecurityFilter set to /* pattern and I need to set the /public/* as a public path. How could it be done?
I can't use the valve approach with security-constraints.
I am following the example given with the waffle-filter project.
The text was updated successfully, but these errors were encountered: