• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlets, web.xml and Invoker

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The problem with my application is that it has too many servlets because of its architecture and according to http://jakarta.apache.org/tomcat/faq/misc.html#evil we should not use invoker servlet for security reasons. The alternative to invoker servlet is to configure each and every servlet explicitly in web.xml. But configuring approx 280 servlets is not easy and I don't know what impact it would have on the tomcat startup.

Is there any other way e.g. URL rewriting etc?

Thanks.

Regards,

Vikas
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the model-view-controller and front controller patterns make this easier if you implement it using struts action-like classes to contain the logic. Then again, 280 is a lot but not too many servlets to map. This number should be reasonably static so that you don't have to change it too often.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to read this article.
 
Vikas Aggarwal
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies.

I have implementted a front controller. Thsi sis what I have done:

1. Created a front controller which gets invoked when a URL with /ted/ is entered.

2. It finds the servlet that it needs send request to.

3. It forwards the request to that servlet.

Other points to note are:

1. Invoker servlet is disabled.

2. The servlets are mapped in web.xml (I tried using just 1 servlet named testservlet for this experiment and hard coded that servlet name in front controller).

3. The displatcher path in controller is "/testservlet".


But this does not work. It gives 404.

Can you please help me out.

Regards,
Vikas
 
reply
    Bookmark Topic Watch Topic
  • New Topic