how to implement a front controller?

Maciek Zywno <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <013701c3306f$eea9e2c0$ade871d9@mo1lazaux0xsfe>
hello

I wanted to write a simple front controller. As for now it is to do nothing else than just take a look inside a request, check what page a client wants to see and just forward a request to an appropriate page. Is it possible? 
In my web.xml I put mapping for all requests to be checked by my front controller:
<servlet>
    <servlet-name>FrontController</servlet-name>
    <servlet-class>frontController</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>FrontController</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

in doProcess:

String urlTarget = request.getgetPathInfo();
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(urlTarget);
dispatcher.forward( request, response );

when I try to visit any page in my webapp I get the error
java.lang.ClassCastException
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:243)
        .....                at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
                ....Do you have any idea of what is wrong with my piece of code?thanks in advance
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.