MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology


Class ActionMapping in struts-config.xml Implementation
Previous Home Next

In order to operate successfully, our controller servlet needs to know several things about how each request URI should be mapped to an appropriate Action class. The required knowledge has been encapsulated in a Java class named ActionMapping, the most important properties are as follows:

  • type - Fully qualified Java class name of the Action implementation class used by this mapping.
  • name - The name of the form bean defined in the config file that this action will use.
  • path - The request URI path that is matched to select this mapping. See below for examples of how matching works and how to use wildcards to match multiple request URIs.
  • unknown - Set to true if this action should be configured as the default for this application, to handle all requests not handled by another action. Only one action can be defined as a default within a single application.
  • validate - Set to true if the validate method of the action associated with this mapping should be called.
  • forward - The request URI path to which control is passed when this mapping is invoked. This is an alternative to declaring a type property.
//Default mapping into struts-config.xml file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation
//DTD Struts Configuration 1.3//EN"
 <!-- Model of your application or Beans map here -->
<!-- Forward page map here-->
<forward name="welcome"  path="/"/>
<!-- Action class, ActionForward,success page,
failure page, and all the action related stuff
map here -->
<action path="/Welcome" forward="/welcomeStruts.jsp"/>
<!-- Validator only work on form or where 
validity is required-->


<form-validation> <formset> <form name="welcomeStruts"> <field property="username" depends="required"> <msg name="required" key="error.username"/> </field> <field property="password" depends="required"> <msg name="required" key="error.password"/> </field> </form> </formset> </form-validation> <controller processorClass="org.apache .struts.tiles.TilesRequestProcessor"/> <!--ApplicationResource file map here --> <message-resources parameter="com/myapp /struts/ApplicationResource"/> <!-- ======= Tiles plugin =============--> <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" /> <set-property property="moduleAware" value="true" /> </plug-in> <!-- ========== Validator plugin ============ --> <plug-in className="org.apache.struts.validator .ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml"/> </plug-in> </struts-config>
Previous Home Next