Skip to content

Instantly share code, notes, and snippets.

@saltnlight5
Created November 29, 2012 05:37
Show Gist options
  • Save saltnlight5/4167024 to your computer and use it in GitHub Desktop.
Save saltnlight5/4167024 to your computer and use it in GitHub Desktop.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app
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"
version="3.0">
<description>Groovy Web Application</description>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>GroovyServlet</servlet-name>
<servlet-class>groovy.servlet.GroovyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GroovyServlet</servlet-name>
<url-pattern>*.groovy</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>TemplateServlet</servlet-name>
<servlet-class>groovy.servlet.TemplateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TemplateServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
<?xml version="1.0"?>
<web-app 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_2_5.xsd"
version="2.5">
<description>Java Servlet Web Application</description>
<servlet>
<servlet-name>HealthServlet</servlet-name>
<servlet-class>deng.HealthServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HealthServlet</servlet-name>
<url-pattern>/health</url-pattern>
</servlet-mapping>
<!-- Web container security configuration -->
<!-- BASIC auth method
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
-->
<!-- Login form method
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/login-failed.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>manager</role-name>
</security-role>
<security-role>
<role-name>AllUsersRole</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>secured-resources</web-resource-name>
<url-pattern>/secured/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
<role-name>AllUsersRole</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint> -->
</web-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment