################# web.xml.......
<web-app>
<display>A Sample Application</display>
<!-- If the element below appears the application is distributable -->
<distributable/>
<!-- WELCOME FILES -->
<!-- if a url includes folder name, and one of the welcome file is in that folder, it picks that, first match wins -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<!-- FILTER CONFIGURATION -->
<filter>
<filter-name>MyFilter</filter-name>
<filter-class>com.example.HelloFilter</filter-class>
<!-- optional and multiple -->
<init-param>
<param-name>FilterName</param-name>
<param-value>Hello Filter</param-value>
</init-param>
<init-param>
<param-name>LogFileName</param-name>
<param-value>UserLog.txt</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>MyFilter</filter-name>
<!-- all the mapping urls mapped first them the servlets -->
<url-pattern>*.do</url-pattern>
<!-- or -->
<servlet-name>MyServlet</servlet-name>
<!-- optional and multiple -->
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<!-- LISTENER CONFIGURATION/where the attribute itself need to be notified does not require configuration -->
<listener>
<listener-class>com.example.MyContextListener</listener-class>
</listener>
<!-- SERVLET CONFIGURATION -->
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.example.HelloServlet</servlet-class>
<!-- or -->
<jsp-file>/hello.jsp</jsp-file>
<!-- optional and one only, greater value than 0 means don't wait for the first request load it beforehand -->
<load-on-startup>1</load-on-startup>
<!-- optional and multiple -->
<init-param>
<param-name>emailid</param-name>
<param-value>[email protected]</param-value>
</init-param>
<!-- optional and multiple -->
<security-role-ref>
<role-name>Manager-TOM HENRY</role-name>
<role-link>admin</role-link>
</security-role-ref>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- JSP CONFIGURATION -->
<jsp-config>
<jsp-property-group>
<url-pattern>*.do</url-pattern>
<scipting-invalid>true</scipting-invalid>
<el-ignored>false</el-ignored>
</jsp-property-group>
<taglib>
<taglib-uri>helloWorld</taglib-uri>
<taglib-location>/WEB-INF/hello.tld</taglib-location>
</taglib>
</jsp-config>
<!-- SESSION CONFIGURATION -->
<session-config>
<session-timeout>15</session-timeout>
</session-config>
<!-- ERROR PAGE CONFIGURATION -->
<error-page>
<exception-type>java.lang.ArithimeticException</exception-type>
<!-- or -->
<error-code>500</error-code>
<location>/WEB-INF/error.jsp</location>
</error-page>
<!-- CONTENT TYPE CONFIGURATION -->
<mime-mapping>
<extension>text</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<!-- ALL SECURITY RELATED CONFIGURATIONS -->
<security-role>
<role-name>admin</role-name>
<role-name>manager</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>My Security</web-resource-name>
<!-- one or many -->
<url-pattern>/hello/*.do</url-pattern>
<!-- optional and multiple/ if below tag is not specified all the methods are constrained -->
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<!-- optional and multiple/none means all empty means none -->
<role-name>admin</role-name>
<role-name>manager</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
<!-- or
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
<transport-guarantee>INTEGRAL</transport-guarantee>
-->
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<!-- one or many -->
<!-- or
<auth-method>DIGEST</auth-method>
<auth-method>CLIENT-CERT</auth-method>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
-->
</login-config>
<!-- ALL EJD/JNDI RELATED CONFIGURATIONS -->
<env-entry>
<env-entry-name></env-entry-name>
<env-entry-type></env-entry-type>
<env-entry-value></env-entry-value>
</env-entry>
<ejb-local-ref>
<ejb-ref-name>ejb/Customer</ejb-ref-name>
<ejb-ref-type>ENTITY</ejb-ref-type>
<local-home>com.example.CustHome</local-home>
<local>come.exampleCust</local>
</ejb-local-ref>
<ejb-ref>
<ejb-ref-name>ejb/Customer</ejb-ref-name>
<ejb-ref-type>ENTITY</ejb-ref-type>
<home>com.example.CustHome</home>
<remote>com.example.Cust</remote>
</ejb-ref>
<resource-env-ref>
<resource-env-ref-name>jms/stockQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
<resource-ref>
<res-ref-name>jdbc/EmpDB</res-ref-name>
<res-type>javax.sql.Datasource</res-type>
<res-auth>CONTAINER</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</web-app>
################# and taglib.tld
<taglib>
<tlib-version>1.2</tlib-version>
<short-name>Hello</short-name>
<uri>hello</uri>
<!-- CALLING STATIC METHODS FROM EL(EL FUNCTION CONFIGURATION -->
<function>
<name>rollIt</name>
<function-class>foo.DiceRoller</function-class>
<function-signature>int rollDice(java.lang.String)</function-signature>
</function>
<!-- CUSTOM TAGS(SIMPLE/CLASSIC) CONFIGURATION -->
<tag>
<description>For Classic/Simple Tags</description>
<name>custom</name>
<tag-class>com.example.TagHandler</tag-class>
<body-content>empty</body-content>
<!-- any of the below -->
<body-content>scriptless</body-content>
<body-content>tagdependent</body-content>
<body-content>JSP</body-content> (only for classic tags)
<attribute>
<name>age></name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<variable>
<name-from-attribute>id</name-from-attribute>
<variable-class>example.person.Contact</variable-class>
<declare>true</declare>
<!-- optional and one -->
<declare>false</declare>
<declare>yes</declare>
<declare>no</declare>
<scope>AT_BEGIN</scope>
<!-- optional and one -->
<scope>AT_END</scope>
<scope>NESTED</scope>
</variable>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<!-- LET KNOW THE CONTAINER WHERE THE TAG FILES ARE KEPT(ONLY IN CASE OF JAR) -->
<tag-file>
<name>custom</name>
<path>/META-INF/tags/custom.tag</path>
</tag-file>
</taglib>
Mission SCWCD. Mission SCJP Complete: SCJP 1.4 - 91%
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Don't MAKE me come back there with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|