O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specifying Struts in the web.xml DD

As far as the Container is concerned, the ActionServlet is just another servlet. So, you have to declare it and make sure all of the web app’s requests are mapped to it.

image with no caption

Note

You should name the Struts DD “struts-config.xml”

And if you do NOT, then in your web.xml DD, you MUST declare an init-param “config”, to define the name of the Struts DD. If you DO use the name “struts-config.xml”, then Struts will find it automatically, without an init-parameter, but it’s still considered “good practice” to declare it in the DD.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required