wood burning stoves 2.0*
The moose likes Servlets and the fly likes FrontController Endless Loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "FrontController Endless Loop" Watch "FrontController Endless Loop" New topic
Author

FrontController Endless Loop

Jim Hall
Ranch Hand

Joined: Nov 29, 2001
Posts: 162
I am trying to implement the Front Controller pattern for all requests through my application.
In web.xml:

This is basically just what Sun has on their site for implementing this pattern.
And in the FrontController servlet I am trying to forward to jsp pages using the RequestDispatcher.forward method. I have tried it with both the ServletRequest and ServletContext objects. When I call a page it overflows the stack because the servlet keeps calling itself. What am I doing wrong?
Thanks,
Jim
[ January 17, 2002: Message edited by: Jim Hall ]
ht kim
Greenhorn

Joined: Aug 02, 2001
Posts: 7
you wrote <url-pattern>*</url-pattern>
then all requsts are gonna send to FC servlet
include your *.jsp forwarding request.
one possible way to solve this problem is,
change the url-pattern in web.xml(ex. *.go).
then *.go url will be requested to FC,
and inside FC, forwarding to *.jsp will work okay.
 
 
subject: FrontController Endless Loop
 
Similar Threads
Servlet Mapping
is not available
Access DispatcherServlet in a GenericFilterBean
Filter
Servlet Mapping problem - please help