diff options
Diffstat (limited to 'src/main/resources/webapp/WEB-INF')
-rw-r--r-- | src/main/resources/webapp/WEB-INF/shiro.ini | 18 | ||||
-rw-r--r-- | src/main/resources/webapp/WEB-INF/tags/common/footer.tagx | 9 | ||||
-rwxr-xr-x | src/main/resources/webapp/WEB-INF/tags/common/head.tagx | 42 | ||||
-rw-r--r-- | src/main/resources/webapp/WEB-INF/tags/common/headjs.tagx | 10 | ||||
-rwxr-xr-x | src/main/resources/webapp/WEB-INF/urlrewrite.xml | 38 | ||||
-rw-r--r-- | src/main/resources/webapp/WEB-INF/web.xml | 76 |
6 files changed, 193 insertions, 0 deletions
diff --git a/src/main/resources/webapp/WEB-INF/shiro.ini b/src/main/resources/webapp/WEB-INF/shiro.ini new file mode 100644 index 0000000..21015af --- /dev/null +++ b/src/main/resources/webapp/WEB-INF/shiro.ini @@ -0,0 +1,18 @@ +[main] + +authc.loginUrl=/login.jspx +roles.unauthorizedUrl = /access-denied.jsp + +sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher + +myCredentialsMatcher = org.apache.shiro.authc.credential.AllowAllCredentialsMatcher + +myRealm = io.trygvis.esper.testing.web.MissingShiroJdbcRealm +myRealm.authenticationQuery = select 'wat' from person where mail = ? +myRealm.credentialsMatcher = $myCredentialsMatcher + +[urls] + +/external/** = anon + +/login.jspx = authc diff --git a/src/main/resources/webapp/WEB-INF/tags/common/footer.tagx b/src/main/resources/webapp/WEB-INF/tags/common/footer.tagx new file mode 100644 index 0000000..7f686ee --- /dev/null +++ b/src/main/resources/webapp/WEB-INF/tags/common/footer.tagx @@ -0,0 +1,9 @@ +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <footer id="footer"> + <div class="container"> + + <p>Footer, yo!</p> + + </div> + </footer> +</jsp:root> diff --git a/src/main/resources/webapp/WEB-INF/tags/common/head.tagx b/src/main/resources/webapp/WEB-INF/tags/common/head.tagx new file mode 100755 index 0000000..f651c2b --- /dev/null +++ b/src/main/resources/webapp/WEB-INF/tags/common/head.tagx @@ -0,0 +1,42 @@ +<!--suppress JspAbsolutePathInspection --> +<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" + xmlns:c="http://java.sun.com/jsp/jstl/core"> + <jsp:output omit-xml-declaration="yes"/> + <jsp:directive.attribute name="title" type="java.lang.String" required="false"/> + <jsp:directive.attribute name="app" type="java.lang.String" required="false"/> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title><c:if test="${not empty title }">${title } - </c:if>Yeah</title> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <link type="text/css" rel="stylesheet" href="/external/bootstrap-2.2.2/css/bootstrap.css"/> + <link type="text/css" rel="stylesheet" href="/external/bootstrap-2.2.2/css/bootstrap-responsive.css"/> + <link type="text/css" rel="stylesheet" href="/external/angular-ui/ng-grid-1.5.0/ng-grid.css"/> + <link type="text/css" rel="stylesheet" href="/apps/app.css"/> + + <script type="text/javascript" src="/external/headjs-0.99/head.min.js"><!-- --></script> + <script type="text/javascript"> + head.js( + {jquery: "/external/jquery-1.8.3/jquery-1.8.3.js"}, + {angularjs: "/external/angular-1.0.3/angular.js"}, + {angularjsResource: "/external/angular-1.0.3/angular-resource.js"}, + {angularUiNgGrid: "/external/angular-ui/ng-grid-1.6.0/ng-grid-1.6.0.debug.js"}, + {underscore: "/external/underscore-1.4.3/underscore.js"}, + {datejs: "/external/datejs-Alpha1/date.js"}, + {app: "/apps/app.js"}, + {PagingTableService: "/apps/core/PagingTableService.js"} + ); + </script> + <script>var noCache = new Date().getTime();</script> + + <jsp:doBody/> + + <script type="text/javascript"> + head.ready(function() { + angular.bootstrap(document, [<c:out value="${app}"/>]); + }); + </script> + </head> + +</jsp:root> diff --git a/src/main/resources/webapp/WEB-INF/tags/common/headjs.tagx b/src/main/resources/webapp/WEB-INF/tags/common/headjs.tagx new file mode 100644 index 0000000..4e39e63 --- /dev/null +++ b/src/main/resources/webapp/WEB-INF/tags/common/headjs.tagx @@ -0,0 +1,10 @@ +<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" + xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> + <jsp:directive.tag body-content="empty"/> + <jsp:directive.attribute name="label" type="java.lang.String" required="true"/> + <jsp:directive.attribute name="resource" type="java.lang.String" required="true"/> + + <script type="text/javascript"> + head.js({'${label}':'<c:out value="${resource}"/>?noCache=' + noCache}); + </script> +</jsp:root> diff --git a/src/main/resources/webapp/WEB-INF/urlrewrite.xml b/src/main/resources/webapp/WEB-INF/urlrewrite.xml new file mode 100755 index 0000000..cc02ca8 --- /dev/null +++ b/src/main/resources/webapp/WEB-INF/urlrewrite.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" + "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd"> + +<!-- + + See http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/4.0/index.html + +--> + +<urlrewrite> + + <rule match-type="wildcard"> + <from>/</from> + <to type="forward">/index.jspx</to> + </rule> + + <!-- + <rule match-type="regex"> + <from>^/person/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/?$</from> + <set type="parameter" name="uuid">$1</set> + <to type="forward">/person/person.jspx</to> + </rule> + + <rule match-type="regex"> + <from>^/person/([-_0-9A-Za-z]{22})/?$</from> + <set type="parameter" name="uuid">$1</set> + <to type="forward">/person/person.jspx</to> + </rule> + --> + + <rule match-type="regex"> + <from>^/build/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$</from> + <set type="parameter" name="uuid">$1</set> + <to type="forward">/build/build.jspx</to> + </rule> + +</urlrewrite> diff --git a/src/main/resources/webapp/WEB-INF/web.xml b/src/main/resources/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..ed33a8f --- /dev/null +++ b/src/main/resources/webapp/WEB-INF/web.xml @@ -0,0 +1,76 @@ +<?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"> + <listener> + <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class> + </listener> + + <filter> + <filter-name>ShiroFilter</filter-name> + <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class> + </filter> + + <filter> + <filter-name>Url Rewrite Filter</filter-name> + <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> + + <!-- set the amount of seconds the conf file will be checked for reload + can be a valid integer (0 denotes check every time, + -1 denotes no reload check, default -1) --> + <init-param> + <param-name>confReloadCheckInterval</param-name> + <param-value>60</param-value> + </init-param> + + <!-- sets up log level (will be logged to context log) + can be: slf4j, TRACE, DEBUG, INFO (default), WARN, ERROR, FATAL, + sysout:{level} (ie, sysout:DEBUG) + if you are having trouble using normal levels use sysout:DEBUG + (default WARN) --> + <init-param> + <param-name>logLevel</param-name> + <param-value>slf4j</param-value> + </init-param> + </filter> + + <filter> + <filter-name>Jersey</filter-name> + <filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class> + <init-param> + <param-name>javax.ws.rs.Application</param-name> + <param-value>io.trygvis.esper.testing.web.JerseyApplication</param-value> + </init-param> + <init-param> + <param-name>jersey.config.servlet.filter.staticContentRegex</param-name> + <param-value>/(image|css|external)/.*</param-value> + </init-param> + <init-param> + <param-name>com.sun.jersey.config.feature.FilterForwardOn404</param-name> + <param-value>true</param-value> + </init-param> + <init-param> + <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> + <param-value>true</param-value> + </init-param> + </filter> + + <filter-mapping> + <filter-name>ShiroFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <filter-mapping> + <filter-name>Url Rewrite Filter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <filter-mapping> + <filter-name>Jersey</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <welcome-file-list> + <welcome-file>index.jspx</welcome-file> + </welcome-file-list> +</web-app> |