Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

is it necessary to write struts-confing.xml ,what tags are
important in that xml file?

Answer Posted / rajasekhar

Yes, it is necessary to provide the configuration file. But
it is not compulsary that the name of the file should be
struts-config.xml. We need to configure the name of the
file in the deployment descreptor(web.xml) of the web
application.

<servlet>
<servlet-name>action</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>.....
<servlet>

Important tag in the configuration files are:
<struts-config>
<form-beans>
<form-bean name=" employForm" class="com.emp.EmployForm"/>
</form-beans>
<global-forwards>
<forward name="success" path="success.jsp" />
</global-forwards>
<global-exceptions>
<excetption key="some.key" type="ExceptionType"
path="SomeException.jsp" />
</global-exception>
<action-mappings>
<action path="/login" name="employForm"
type="com.emp.EmployAction" scope="request\session"
input="/login.jsp" validate="true/false" >
<forward name="success" path="/Mainpage.jsp" />
<forward name="failure" path="/Errorpage.sp" />
</action>
</action-mappings>
<controller
processorClass="org.apache.struts.action.RequestProcessor"/>
<message-resource parameter="applicationResources" />
</struts-config>

Is This Answer Correct ?    20 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the struts2 error message keys that can come during file uploading process?

1011


What is the apache struts vulnerability?

889


Why are struts tightly coupled?

935


What is the purpose of @emailvalidator annotation?

955


How duplicate form submission can be controlled in struts?

1065


How is the mvc design pattern used in struts framework?

911


Why was reload removed from struts (since 1.1)?

933


What is the use of namespace in action mapping in Struts2?

1002


What do you mean by ognl?

948


Which design pattern is implemented by Struts2 interceptors?

943


What is structs 2 validation framework?

941


What are the features of struts?

969


What is actioninvocation?

899


How do you convert struts to springs?

974


Which class is the Front Controller in Struts2?

928