Hi, Here is an example:

  | import java.io.IOException;
  | 
  | import javax.servlet.*;
  | import javax.servlet.http.*;
  | 
  | 
  | public class InitFilter implements Filter {
  |     
  | private FilterConfig config;
  | 
  | /**Init.
  |  * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
  |  */
  | public void init(FilterConfig config) throws ServletException {
  |     this.config = config;
  | }
  | 
  | /[EMAIL PROTECTED] javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, 
  |  * javax.servlet.ServletResponse, javax.servlet.FilterChain)
  |  */
  | public void doFilter(ServletRequest request, ServletResponse response, FilterChain 
chain) throws IOException, ServletException {
  |    
  |     HttpServletRequest req = (HttpServletRequest) request;
  |     HttpServletResponse resp = (HttpServletResponse) response;
  |     if(this.isInitialized())
  |         chain.doFilter(request, response);
  |     else
  |        resp.sendRedirect(resp.encodeRedirectURL(req.getContextPath() + 
"/initServlet"));
  | 
  | }
  | 
  | private boolean isInitialized(HttpServletRequest requets){
  |   //check 
  | return result;
  | }
  | 

Maybe you wonÂt need the initSevlet anymore, just start the initialization from the 
filter

Hope could help

ciao
anis

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834096#3834096

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834096


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to