• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlets, web.xml and Invoker

 
Vikas Aggarwal
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • 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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to read this article.
 
Vikas Aggarwal
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!