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 is the purpose of @before annotation?

991


Are interceptors thread safe?

996


What is actioncontext?

935


What is the purpose of @urlvalidator annotation?

977


How many action classes can be used in struts application?

969


Which file is used by controller to get mapping information for request routing?

1046


What do you mean by inner class and anonymous class?

1066


how to connect from struts to database through hibernet and where u can modify the class

2540


What are action errors and error?

1024


What are the contents on web.xml in struts application ?

966


Define struts?

1028


Does Struts2 action and interceptors are thread safe?

1061


Which design pattern the interceptors in struts2 is based on?

906


What is the difference between empty default namespace and root namespace?

1110


How you will enable front-end validation based on the xml in validation.xml?

1060