diff --git a/web-polling/p.war b/web-polling/p.war index af98ae9b73092ebffab78d7202f8029036db5cea..3870994b78bcb38150a39d2a2f016f0cf7349c78 100755 Binary files a/web-polling/p.war and b/web-polling/p.war differ diff --git a/web-polling/p/WebContent/WEB-INF/lib/urlrewritefilter-4.0.3.jar b/web-polling/p/WebContent/WEB-INF/lib/urlrewritefilter-4.0.3.jar new file mode 100755 index 0000000000000000000000000000000000000000..08f6ba281c302c81adc5ea3b1166e5a423058607 Binary files /dev/null and b/web-polling/p/WebContent/WEB-INF/lib/urlrewritefilter-4.0.3.jar differ diff --git a/web-polling/p/WebContent/WEB-INF/urlrewrite.xml b/web-polling/p/WebContent/WEB-INF/urlrewrite.xml new file mode 100644 index 0000000000000000000000000000000000000000..2707ba0eb9cb065ad93e79b50e0feefdc37213bb --- /dev/null +++ b/web-polling/p/WebContent/WEB-INF/urlrewrite.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN" + "http://tuckey.org/res/dtds/urlrewrite3.2.dtd"> + +<!-- + + Configuration file for UrlRewriteFilter + http://tuckey.org/urlrewrite/ + +--> +<urlrewrite> + + <rule> + <note> + The rule means that requests to /test/status/ will be redirected to /rewrite-status + the url will be rewritten. + </note> + <from>/test/status/</from> + <to type="redirect">%{context-path}/rewrite-status</to> + </rule> + + + <outbound-rule> + <note> + The outbound-rule specifies that when response.encodeURL is called (if you are using JSTL c:url) + the url /rewrite-status will be rewritten to /test/status/. + + The above rule and this outbound-rule means that end users should never see the + url /rewrite-status only /test/status/ both in thier location bar and in hyperlinks + in your pages. + </note> + <from>/rewrite-status</from> + <to>/test/status/</to> + </outbound-rule> + + + <!-- + + INSTALLATION + + in your web.xml add... + + <filter> + <filter-name>UrlRewriteFilter</filter-name> + <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> + <init-param> + <param-name>logLevel</param-name> + <param-value>WARN</param-value> + </init-param> + </filter> + <filter-mapping> + <filter-name>UrlRewriteFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + EXAMPLES + + Redirect one url + <rule> + <from>/some/old/page.html</from> + <to type="redirect">/very/new/page.html</to> + </rule> + + Redirect a directory + <rule> + <from>/some/olddir/(.*)</from> + <to type="redirect">/very/newdir/$1</to> + </rule> + + Clean a url + <rule> + <from>/products/([0-9]+)</from> + <to>/products/index.jsp?product_id=$1</to> + </rule> + eg, /products/1234 will be passed on to /products/index.jsp?product_id=1234 without the user noticing. + + Browser detection + <rule> + <condition name="user-agent">Mozilla/[1-4]</condition> + <from>/some/page.html</from> + <to>/some/page-for-old-browsers.html</to> + </rule> + eg, will pass the request for /some/page.html on to /some/page-for-old-browsers.html only for older + browsers whose user agent srtings match Mozilla/1, Mozilla/2, Mozilla/3 or Mozilla/4. + + Centralised browser detection + <rule> + <condition name="user-agent">Mozilla/[1-4]</condition> + <set type="request" name="browser">moz</set> + </rule> + eg, all requests will be checked against the condition and if matched + request.setAttribute("browser", "moz") will be called. + + --> + + <rule> + <from>([0-9]+)</from> + <to>polls.jsp?poll=$1</to> + </rule> + +</urlrewrite> + diff --git a/web-polling/p/WebContent/WEB-INF/web.xml b/web-polling/p/WebContent/WEB-INF/web.xml index 299ee845fbfc2e01bcda7f07ae40a7113cd94c27..9b57fa5637b4708e0e0c80ebb8c11d74accb0d05 100755 --- a/web-polling/p/WebContent/WEB-INF/web.xml +++ b/web-polling/p/WebContent/WEB-INF/web.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> - <display-name>p</display-name> - <welcome-file-list> - <welcome-file>index.html</welcome-file> - <welcome-file>index.htm</welcome-file> - <welcome-file>index.jsp</welcome-file> - <welcome-file>default.html</welcome-file> - <welcome-file>default.htm</welcome-file> - <welcome-file>default.jsp</welcome-file> - </welcome-file-list> -</web-app> \ No newline at end of file +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" + id="WebApp_ID" version="2.5"> + + <display-name>BigBlueButton Polls</display-name> + <description> + This is version 1.0 of the web-polling BigBlueButton application. + It was written by Chad Pilkey (capilkey@gmail.com) in association + with the Seneca Center for Development of Open Technology (Seneca CDOT). + </description> + + <filter> + <filter-name>UrlRewriteFilter</filter-name> + <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>UrlRewriteFilter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <welcome-file-list> + <welcome-file>polls.jsp</welcome-file> + </welcome-file-list> +</web-app>