Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

actions are not servlets..then what is the purpose of adding servlet elements for action in web.xml

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
actions are not servlets right? then why do i have to add servlet elements for the action classes in my web.xml? but in my project they have added only the servlets in the web.xml not the actions... can anyone please explain it??
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Action are not servlets, correct. But there is an ActionServlet (the "controller") that determines what action will handle each request. It's configured in the web.xml because that's where you configure servlets.

Actions are configured in the Struts configuration file because they're framework-specific classes--nothing to do with default Java web application mechanisms. They *could* have used a configuration mechanism that leveraged the web.xml file, I suppose (although I'm not sure if that capability existed when Struts 1 first came about), but it's separate, which makes sense to me.
 
Prakash Mani - Attur
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry.. i have removed the servlet elements from the web.xml except the actionservlet, that worked fine..its my mis understanding... can anyone please tell what are the init params we can have in servlet element in the web.xml...
 
reply
    Bookmark Topic Watch Topic
  • New Topic