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

Struts

Struts web.xml and conig.xml
Previous Home Next
  1. Now Your web.xml file which hold your Action Class or ActionServlet , config struts-cofig.xml, and all the TagLibary import into your application.
  2. <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001
    /XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <!-- Action Class/ActionServlet Map here -->
     <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>
    <init-param>
     <param-name>debug</param-name>
     <param-value>2</param-value>
    </init-param>
    <init-param>
     <param-name>detail</param-name>
     <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
     </servlet>
     <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
     </servlet-mapping>
     <session-config>
    <session-timeout>
     30
    </session-timeout>
     </session-config>
    	<!-- First JSP page( index) map here -->
     <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
     <jsp-config>
    	<!-- All TagLibrary map here -->
    <taglib>
     <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
     <taglib-location>/WEB-INF/struts-bean.tld
    	</taglib-location>
    </taglib>
    <taglib>
     <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
     <taglib-location>/WEB-INF/struts-html.tld
     </taglib-location>
    </taglib>
    <taglib>
     <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
     <taglib-location>/WEB-INF/struts-logic.tld
     </taglib-location>
    </taglib>
    <taglib>
     <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
     <taglib-location>/WEB-INF/struts-nested.tld
     </taglib-location>
    </taglib>
    <taglib>
     <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
     <taglib-location>/WEB-INF/struts-tiles.tld
     </taglib-location>
    </taglib>
     </jsp-config>
    </web-app>
    
  3. Your struts-config.xml file here:
  4. <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation
    //DTD Struts Configuration 1.3//EN"
    "http://jakarta.apache.org/struts
    /dtds/struts-config_1_3.dtd">
    <struts-config>
    <form-beans>
    <!-- Model of your application or Beans map here -->
    </form-beans>
    <global-exceptions>
    </global-exceptions>
    <!-- Forward page map here-->
    <global-forwards>
    <forward name="welcome"  path="/Welcome.do"/>
    </global-forwards>
    <!-- Action class, success page, failure page,
    and all the action related stuff map here -->
    <action-mappings>
    <action path="/Welcome" forward="/welcomeStruts.jsp"/>
    </action-mappings> 
    <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>
    

     

  5. Output of your program, with some changes into title, headline and message
Previous Home Next