public class PasswordFilter extends java.lang.Object implements Filter
Enable with:
<filter filter-name='password'
filter-class='com.caucho.filters.PasswordFilter'/>
<filter-mapping filter-name='password'
url-pattern='j_security_check'/>
Test with this in a JSP:
<% if (request.getUserPrincipal() != null) { %>
username: <%= request.getRemoteUser() %>
password: <%= session.getAttribute("java.naming.security.credentials") %>
<% } %>
This will work with a form based login.| Constructor and Description |
|---|
PasswordFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Cleanup the filter.
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain next)
doFilter performs the actual work of a filter, either modifying
the request or the response.
|
void |
init(FilterConfig config)
Initialize the filter.
|
public void init(FilterConfig config)
Filterpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain next) throws java.io.IOException, ServletException
FilterdoFilter in interface Filterrequest - the servlet requestresponse - the servlet responsenext - the next filter in the chainjava.io.IOExceptionServletException