Editing web.xml in a Struts Application

By: Gokul Verma  

The web.xml file is where servlets and other stuff are defined to the servlet container. We'll remove some unnecessary things from the web.xml file so it looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"


  <!-- Standard Action Servlet Configuration (with debugging) -->

  <!-- Standard Action Servlet Mapping -->

  <!-- Struts Tag Library Descriptors -->




The web.xml file -

The file contains three sections:

  1. the definition of the Struts servlet named "ActionServlet"
  2. the URL mapping for the calls to this servlet
  3. the definitions of the Struts tag libraries

You'll see that the servlet will be called if our browser requests a file called <some-name>.do. So when we submit the form in our one-page application we'll decide to use the action-name "submit.do". How the Struts servlet knows what to do with this request we'll discover next.

Most Viewed Articles (in Struts )

Latest Articles (in Struts)

Comment on this tutorial

Subscribe to Tutorials

Related Tutorials

Archived Comments

1. yes simple good it wroking goog
View Tutorial          By: durga prasad pavirala at 2009-02-11 03:43:04

2. where should i define some property so as my site
View Tutorial          By: juan villegas at 2010-06-12 01:24:43

3. good
View Tutorial          By: rajesh sharma at 2011-07-18 05:20:56

4. what is the usage of 'detail' and 'debug' init par
View Tutorial          By: uday at 2011-07-21 04:53:02

5. need to be place taglig in the <jsp-config>
View Tutorial          By: Shaik Basha at 2013-01-30 03:11:41