This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Controller Servlet

 
Ramadoss
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can J2EE web application contains many controller servlets?

Thank you in advance.

-Ram
 
Ramadoss
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok let me pull this way since this is a question of wide spectrum.

We have J2EE application which is comprises of multimple modules but basically grouped together as a single application and we have our base servlet which we are extending from ActionServlet.

We have a RequestProcessor class configured and I know that this actually does the controller functionality since we are using Struts1.1.

My question is that given then above scenario can we have multiple controller servlet for this J2EE application ? if yes, How could I impelement the same?

Thank you in advance.

-Ramadoss
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could, but you would have to map a different extension to each controller servlet. This is generally discouraged as it makes the app a mess to try and follow.

Instead, look into the modules feature of Struts. You can create separate modules that each have their own struts config file and correspond to separate paths in the URL, such as
/ContextRoot/module1/
/ContextRoot/module2/
etc.

Because each module is independent, you can specify and maintain all the configuration properties separately as you currently are without resorting to a kludge.

 
Ramadoss
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David:
I appreciate your comprehensive reply. By looking at your point I assumed that theoritically an J2EE application can have many Controller Servlets configured though it is not recomended to do so.

-Ramadoss
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic