Contents of web.xml and struts-config.xml

What are the contents of web.xml and struts-config.xml?

- The web.xml file contains the information that is used by servlets and JSPs.

- The file includes the description of the application, information about servlets, mapping information for servlets and URL, JSP configuration information, error page information that is displayed without handling exceptions, mapping information about servlets.

- The struts-config.xml file contains information about struts framework at the time of deploying the web application.

- This file includes information about form bean, action mappings, controller information that includes buffer size, forward pattern, content type, locale, class name, content forward etc.

What are the contents of web.xml and struts-config.xml?

Web.xml example :
<web-app>
  <servlet>

   <servlet-name> XYZ </servlet-name>
   <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

   <init-param>
   <param-name> CONFIG </param-name>
   <param-value>/WEB-INF/struts-config.xml </param-value>
   </init-param>

   <init-param>
   <param-name>host </param-name>
   <param-value>localhost </param-value>
   </init-param>

   <init-param>
   <param-name>port</param-name>
   <param-value>1111</param-value>
   </init-param>
   </servlet>

   <servlet-mapping>
   <servlet-name> XYZ </servlet-name>

   <url-pattern>*.do</url-pattern>

 </servlet-mapping>

</web-app>
- Important attributes and elements of ActionMapping entry in struts-config.xml are:

- Path
- Type
- Name
- Scope
- Validate
- Input
- Forward
Differences between web.xml and sturts-config.xml
Differences between web.xml and sturts-config.xml - web.xml is utilized to make connections between web application and the web container....
Explain how to communicate from struts to ejb
Explain how to communicate from struts to ejb - The Struts framework strictly implements MVC pattern. The execute() method of Action class can be invoked to interact with the Model part of MVC....
Define Struts
What is Struts? Struts are an open framework that is used for development of JAVA web application...
Post your comment