Make web app work on Servlet/JSP 2.3/1.2 and fix some other mistakes

git-svn-id: https://zxing.googlecode.com/svn/trunk@1034 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2009-08-13 11:11:48 +00:00
parent 14b2850f92
commit 3cab89a732
16 changed files with 219 additions and 218 deletions

View file

@ -8,7 +8,7 @@ version=1.4
# Uncomment or set appropriately: # Uncomment or set appropriately:
#WTK-home=C:\\WTK2.5.2 #WTK-home=C:\\WTK2.5.2
#WTK-home=/usr/local/WTK2.5.2 WTK-home=/usr/local/WTK2.5.2
# Set this to the location where you have installed RIM's BlackBerry JDE in order to # Set this to the location where you have installed RIM's BlackBerry JDE in order to
# create the 'rim' client. There is no Mac or Linux version, but, these platforms can still # create the 'rim' client. There is no Mac or Linux version, but, these platforms can still
@ -22,15 +22,15 @@ version=1.4
# Uncomment and set appropriately # Uncomment and set appropriately
#BB-JDK-home=C:\\Program Files\\Research In Motion\\Blackberry JDE 4.3.0 #BB-JDK-home=C:\\Program Files\\Research In Motion\\Blackberry JDE 4.3.0
#BB-JDK-home=/usr/local/bb-home BB-JDK-home=/usr/local/bb-home
# Set this to the location where you installed the Android SDK. # Set this to the location where you installed the Android SDK.
#android-home=/usr/local/android android-home=/usr/local/android
# Set this to the location of a Tomcat installation if you want to compile and run the zxing.org # Set this to the location of a Tomcat installation if you want to compile and run the zxing.org
# web site and web application # web site and web application
#tomcat-home=C:\\tomcat #tomcat-home=C:\\tomcat
#tomcat-home=/usr/local/tomcat tomcat-home=/usr/local/tomcat
# Uncomment and set this variable if building the zxing.appspot.com subdirectory. It points to the # Uncomment and set this variable if building the zxing.appspot.com subdirectory. It points to the
# location of the Google Web Toolkit (GWT) which can be downloaded here: # location of the Google Web Toolkit (GWT) which can be downloaded here:

View file

@ -86,6 +86,7 @@
footer="<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-788492-5"); pageTracker._initData(); pageTracker._trackPageview(); </script>"> footer="<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-788492-5"); pageTracker._initData(); pageTracker._trackPageview(); </script>">
<sourcepath> <sourcepath>
<pathelement location="android/src"/> <pathelement location="android/src"/>
<pathelement location="android/gen"/>
<pathelement location="bug/src"/> <pathelement location="bug/src"/>
<pathelement location="core/src"/> <pathelement location="core/src"/>
<pathelement location="javame/src"/> <pathelement location="javame/src"/>
@ -98,7 +99,7 @@
<pathelement location="${WTK-home}/lib/midpapi20.jar"/> <pathelement location="${WTK-home}/lib/midpapi20.jar"/>
<pathelement location="${WTK-home}/lib/mmapi.jar"/> <pathelement location="${WTK-home}/lib/mmapi.jar"/>
<pathelement location="${WTK-home}/lib/jsr234.jar"/> <pathelement location="${WTK-home}/lib/jsr234.jar"/>
<pathelement location="${android-home}/android.jar"/> <pathelement location="${android-home}/platforms/android-1.5/android.jar"/>
<pathelement location="${BB-JDK-home}/lib/net_rim_api.jar"/> <pathelement location="${BB-JDK-home}/lib/net_rim_api.jar"/>
<pathelement location="${tomcat-home}/lib/servlet-api.jar"/> <pathelement location="${tomcat-home}/lib/servlet-api.jar"/>
<fileset dir="zxingorg/web/WEB-INF/lib"> <fileset dir="zxingorg/web/WEB-INF/lib">

View file

@ -17,7 +17,7 @@
<project name="zxingorg" basedir="." default="build"> <project name="zxingorg" basedir="." default="build">
<property file="../build.properties"/> <property file="../build.properties"/>
<property file="secrets.properties"/> <!--<property file="secrets.properties"/>-->
<target name="init"> <target name="init">
<tstamp/> <tstamp/>
@ -76,17 +76,16 @@
</filterset> </filterset>
</copy> </copy>
--> -->
<war warfile="zxingorg.war" webxml="web/WEB-INF/web.xml"> <war warfile="w.war" webxml="web/WEB-INF/web.xml">
<lib dir="web/WEB-INF/lib"> <lib dir="web/WEB-INF/lib">
<include name="*.jar"/> <include name="*.jar"/>
</lib> </lib>
<classes dir="web/WEB-INF/classes"/> <classes dir="web/WEB-INF/classes"/>
<webinf dir="web/WEB-INF">
<include name="appengine-web.xml"/>
</webinf>
<fileset dir="web"> <fileset dir="web">
<include name="*.jspx"/> <include name="*.jspx"/>
<include name="*.png"/> <include name="*.png"/>
<include name="**/*.jad"/>
<include name="**/*.jar"/>
</fileset> </fileset>
<fileset dir=".."> <fileset dir="..">
<include name="docs/**"/> <include name="docs/**"/>

View file

@ -0,0 +1,12 @@
MIDlet-1: BarcodeReader, /res/zxing-icon.png, com.google.zxing.client.j2me.ZXingMIDlet
MIDlet-Description: ZXing Barcode Reader
MIDlet-Icon: /res/zxing-icon.png
MIDlet-Info-URL: code.google.com/p/zxing
MIDlet-Jar-Size: 96748
MIDlet-Jar-URL: BarcodeReader.jar
MIDlet-Name: BarcodeReader
MIDlet-Permissions: javax.microedition.media.control.VideoControl.getSnapshot
MIDlet-Vendor: ZXing Project
MIDlet-Version: 1.1
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

Binary file not shown.

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>zxing</application>
<version>1</version>
</appengine-web-app>

View file

@ -14,25 +14,12 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<web-app version="2.5" <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
xmlns="http://java.sun.com/xml/ns/javaee" <web-app>
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">
<display-name>zxing.org</display-name> <display-name>zxing.org</display-name>
<welcome-file-list> <distributable/>
<welcome-file>index.jspx</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.apache.commons.fileupload.servlet.FileCleanerCleanup</listener-class>
</listener>
<!--
<listener>
<listener-class>com.google.zxing.web.DecodeEmailListener</listener-class>
</listener>
-->
<!-- <!--
<context-param> <context-param>
@ -45,17 +32,6 @@
</context-param> </context-param>
--> -->
<servlet>
<servlet-name>DecodeServlet</servlet-name>
<servlet-class>com.google.zxing.web.DecodeServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DecodeServlet</servlet-name>
<url-pattern>/decode</url-pattern>
</servlet-mapping>
<filter> <filter>
<filter-name>DoSFilter</filter-name> <filter-name>DoSFilter</filter-name>
<filter-class>com.google.zxing.web.DoSFilter</filter-class> <filter-class>com.google.zxing.web.DoSFilter</filter-class>
@ -66,9 +42,37 @@
<url-pattern>/*</url-pattern> <url-pattern>/*</url-pattern>
</filter-mapping> </filter-mapping>
<listener>
<listener-class>org.apache.commons.fileupload.servlet.FileCleanerCleanup</listener-class>
</listener>
<!--
<listener>
<listener-class>com.google.zxing.web.DecodeEmailListener</listener-class>
</listener>
-->
<servlet>
<servlet-name>DecodeServlet</servlet-name>
<servlet-class>com.google.zxing.web.DecodeServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DecodeServlet</servlet-name>
<url-pattern>/decode</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<mime-mapping> <mime-mapping>
<extension>cod</extension> <extension>cod</extension>
<mime-type>application/vnd.rim.cod</mime-type> <mime-type>application/vnd.rim.cod</mime-type>
</mime-mapping> </mime-mapping>
<welcome-file-list>
<welcome-file>index.jspx</welcome-file>
</welcome-file-list>
</web-app> </web-app>

View file

@ -15,8 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output omit-xml-declaration="true"/>
<script type="text/javascript"> <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

View file

@ -15,13 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output
omit-xml-declaration="false" doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<jsp:directive.page contentType="text/html" session="false"/> <jsp:directive.page contentType="text/html" session="false"/>
<jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet> <jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
<jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></jsp:text>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<title>Bad Image</title> <title>Bad Image</title>

View file

@ -15,13 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output
omit-xml-declaration="false" doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<jsp:directive.page contentType="text/html" session="false"/> <jsp:directive.page contentType="text/html" session="false"/>
<jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet> <jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
<jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></jsp:text>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<title>Bad URL</title> <title>Bad URL</title>

View file

@ -0,0 +1,12 @@
MIDlet-1: BarcodeReader, /res/zxing-icon.png, com.google.zxing.client.j2me.ZXingMIDlet
MIDlet-Description: ZXing Barcode Reader
MIDlet-Icon: /res/zxing-icon.png
MIDlet-Info-URL: code.google.com/p/zxing
MIDlet-Jar-Size: 96743
MIDlet-Jar-URL: BarcodeReader.jar
MIDlet-Name: BarcodeReader
MIDlet-Permissions: javax.microedition.media.control.VideoControl.getSnapshot
MIDlet-Vendor: ZXing Project
MIDlet-Version: 1.1
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

Binary file not shown.

View file

@ -15,13 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output
omit-xml-declaration="false" doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<jsp:directive.page contentType="text/html" session="false"/> <jsp:directive.page contentType="text/html" session="false"/>
<jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet> <jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
<jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></jsp:text>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<title>ZXing Decoder Online</title> <title>ZXing Decoder Online</title>
@ -48,7 +45,7 @@
<a href="http://code.google.com/p/zxing">project page</a> <a href="http://code.google.com/p/zxing">project page</a>
for details. for details.
</p> </p>
<p>Copyright 2008 ZXing authors</p> <p>Copyright 2008 and onwards ZXing authors</p>
<jsp:include page="analytics.jspx"/> <jsp:include page="analytics.jspx"/>
</body> </body>
</html> </html>

View file

@ -15,18 +15,12 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output
omit-xml-declaration="false" doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<jsp:directive.page contentType="text/html" session="false"/> <jsp:directive.page contentType="text/html" session="false"/>
<jsp:scriptlet>response.setHeader("Cache-Control", "no-cache");</jsp:scriptlet> <jsp:scriptlet>response.setHeader("Cache-Control", "no-cache");</jsp:scriptlet>
<jsp:useBean id="result" scope="request" type="com.google.zxing.Result"/> <jsp:useBean id="result" scope="request" type="com.google.zxing.Result"/>
<jsp:useBean id="parsedResult" scope="request" type="com.google.zxing.client.result.ParsedResult"/> <jsp:useBean id="parsedResult" scope="request" type="com.google.zxing.client.result.ParsedResult"/>
<jsp:useBean id="rawBytesString" scope="request" type="java.lang.String"/> <jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></jsp:text>
<jsp:useBean id="text" scope="request" type="java.lang.String"/>
<jsp:useBean id="displayResult" scope="request" type="java.lang.String"/>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<title>Decode Succeeded</title> <title>Decode Succeeded</title>
@ -39,26 +33,26 @@
<table> <table>
<tr> <tr>
<td>Raw text</td> <td>Raw text</td>
<td>${text}</td> <td><jsp:expression>request.getAttribute("text")</jsp:expression></td>
</tr> </tr>
<tr> <tr>
<td>Raw bytes</td> <td>Raw bytes</td>
<td>${rawBytesString}</td> <td><jsp:expression>request.getAttribute("rawBytesString")</jsp:expression></td>
</tr> </tr>
<tr> <tr>
<td>Barcode format</td> <td>Barcode format</td>
<td>${result.barcodeFormat}</td> <td><jsp:getProperty name="result" property="barcodeFormat"/></td>
</tr> </tr>
<tr> <tr>
<td>Parsed Result Type</td> <td>Parsed Result Type</td>
<td>${parsedResult.type}</td> <td><jsp:getProperty name="parsedResult" property="type"/></td>
</tr> </tr>
<tr> <tr>
<td>Parsed Result</td> <td>Parsed Result</td>
<td>${displayResult}</td> <td><jsp:expression>request.getAttribute("displayResult")</jsp:expression></td>
</tr> </tr>
</table> </table>
<p>Copyright 2008 ZXing authors</p> <p>Copyright 2008 and onwards ZXing authors</p>
<jsp:include page="analytics.jspx"/> <jsp:include page="analytics.jspx"/>
</body> </body>
</html> </html>

View file

@ -15,13 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output
omit-xml-declaration="false" doctype-root-element="html"
doctype-public="-//WAPFORUM//DTD XHTML Mobile 1.1//EN"
doctype-system="http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd"/>
<jsp:directive.page contentType="application/xhtml+xml" session="false"/> <jsp:directive.page contentType="application/xhtml+xml" session="false"/>
<jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet> <jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
<jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd">]]></jsp:text>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<title>Download ZXing Reader</title> <title>Download ZXing Reader</title>
@ -35,9 +32,9 @@
(<a href="basic/BarcodeReader.jad">Download</a> the alternate "basic" version for J2ME.) (<a href="basic/BarcodeReader.jad">Download</a> the alternate "basic" version for J2ME.)
</p> </p>
<p> <p>
<a href="BarcodeScanner.apk">Download</a> the Android client. <a href="market://search?q=pname%3Acom.google.zxing.client.android">Download</a> the Android client.
</p> </p>
<p>Copyright 2008 ZXing authors</p> <p>Copyright 2008 and onwards ZXing authors</p>
<jsp:include page="analytics.jspx"/> <jsp:include page="analytics.jspx"/>
</body> </body>
</html> </html>

View file

@ -15,13 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<!-- Author: Sean Owen --> <!-- Author: Sean Owen -->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.0"> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
<jsp:output
omit-xml-declaration="false" doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<jsp:directive.page contentType="text/html" session="false"/> <jsp:directive.page contentType="text/html" session="false"/>
<jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet> <jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
<jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]></jsp:text>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<title>No Barcode Found</title> <title>No Barcode Found</title>