Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

FrontController Endless Loop

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
This tiny ad is suggesting that maybe she should go play in traffic.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!