Skip to content

Instantly share code, notes, and snippets.

@dungdm93
Last active May 7, 2016 07:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dungdm93/5ac48796a0cd252c6374be582488d2b3 to your computer and use it in GitHub Desktop.
Sample web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. -->
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app>
<session-config>
<session-manager/>
</session-config>
<cache enabled="true" timeout-in-seconds="300">
<cache-mapping>
<servlet-name>ServCache</servlet-name>
<key-field name="inputtext" scope="request.parameter"/>
<constraint-field name="inputtext" scope="request.parameter">
<value>one</value>
<value>two</value>
</constraint-field>
</cache-mapping>
</cache>
</sun-web-app>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. -->
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>webapps-caching</display-name>
<servlet>
<servlet-name>ServCache</servlet-name>
<servlet-class>samples.webapps.caching.ServCache</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ServCache</servlet-name>
<url-pattern>/ServCache</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<jsp-config>
<taglib>
<taglib-uri>/com/sun/web/taglibs/cache</taglib-uri>
<taglib-location>/WEB-INF/sun-web-cache.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
@dungdm93
Copy link
Author

dungdm93 commented May 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment