private static final String SMTP_PORT = "465";
private static final String POP_PORT = "995";
private static final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
- private static final Address fromAddress;
private static final Properties sessionProperties = new Properties();
static {
- try {
- fromAddress = new InternetAddress("w@zxing.org", "ZXing By Email");
- } catch (UnsupportedEncodingException uee) {
- throw new RuntimeException(uee);
- }
sessionProperties.setProperty("mail.transport.protocol", "smtp");
sessionProperties.setProperty("mail.smtp.host", SMTP_HOST);
sessionProperties.setProperty("mail.smtp.auth", "true");
}
private final Authenticator emailAuthenticator;
+ private final Address fromAddress;
- DecodeEmailTask(Authenticator emailAuthenticator) {
+ DecodeEmailTask(String emailAddress, Authenticator emailAuthenticator) {
this.emailAuthenticator = emailAuthenticator;
+ try {
+ fromAddress = new InternetAddress(emailAddress, "ZXing By Email");
+ } catch (UnsupportedEncodingException uee) {
+ // Can't happen?
+ throw new RuntimeException(uee);
+ }
}
@Override
*/
public final class DecodeServlet extends HttpServlet {
- private static final long MAX_IMAGE_SIZE = 500000L;
+ private static final long MAX_IMAGE_SIZE = 500000L;
private static final long EMAIL_CHECK_INTERVAL = 60000L;
private static final Logger log = Logger.getLogger(DecodeServlet.class.getName());
static final Hashtable<DecodeHintType, Object> HINTS;
+
static {
HINTS = new Hashtable<DecodeHintType, Object>(3);
HINTS.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
}
private HttpClient client;
- private DiskFileItemFactory diskFileItemFactory;
+ private DiskFileItemFactory diskFileItemFactory;
private Timer emailTimer;
@Override
- public void init(ServletConfig servletConfig) throws ServletException {
+ public void init(ServletConfig servletConfig) throws ServletException {
Logger logger = Logger.getLogger("com.google.zxing");
logger.addHandler(new ServletContextLogHandler(servletConfig.getServletContext()));
Authenticator emailAuthenticator = new EmailAuthenticator(emailAddress, emailPassword);
emailTimer = new Timer("Email decoder timer", true);
- emailTimer.schedule(new DecodeEmailTask(emailAuthenticator), 0L, EMAIL_CHECK_INTERVAL);
+ emailTimer.schedule(new DecodeEmailTask(emailAddress, emailAuthenticator), 0L, EMAIL_CHECK_INTERVAL);
log.info("DecodeServlet configured");
}
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String imageURIString = request.getParameter("u");
- if (imageURIString == null || imageURIString.length() == 0) {
- response.sendRedirect("badurl.jspx");
- return;
- }
+ String imageURIString = request.getParameter("u");
+ if (imageURIString == null || imageURIString.length() == 0) {
+ response.sendRedirect("badurl.jspx");
+ return;
+ }
- if (!(imageURIString.startsWith("http://") || imageURIString.startsWith("https://"))) {
- imageURIString = "http://" + imageURIString;
- }
+ if (!(imageURIString.startsWith("http://") || imageURIString.startsWith("https://"))) {
+ imageURIString = "http://" + imageURIString;
+ }
- URI imageURI;
- try {
- imageURI = new URI(imageURIString);
- } catch (URISyntaxException urise) {
- response.sendRedirect("badurl.jspx");
- return;
- }
+ URI imageURI;
+ try {
+ imageURI = new URI(imageURIString);
+ } catch (URISyntaxException urise) {
+ response.sendRedirect("badurl.jspx");
+ return;
+ }
HttpGet getRequest = new HttpGet(imageURI);
- try {
+ try {
HttpResponse getResponse = client.execute(getRequest);
if (getResponse.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK) {
- response.sendRedirect("badurl.jspx");
- return;
- }
- if (!isSizeOK(getResponse)) {
- response.sendRedirect("badimage.jspx");
- return;
- }
+ response.sendRedirect("badurl.jspx");
+ return;
+ }
+ if (!isSizeOK(getResponse)) {
+ response.sendRedirect("badimage.jspx");
+ return;
+ }
log.info("Decoding " + imageURI);
InputStream is = getResponse.getEntity().getContent();
- try {
- processStream(is, response);
- } finally {
- is.close();
- }
+ try {
+ processStream(is, response);
+ } finally {
+ is.close();
+ }
} catch (InterruptedException ie) {
getRequest.abort();
response.sendRedirect("badurl.jspx");
} catch (HttpException he) {
getRequest.abort();
response.sendRedirect("badurl.jspx");
- }
+ }
- }
+ }
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
- if (!ServletFileUpload.isMultipartContent(request)) {
- response.sendRedirect("badimage.jspx");
- return;
- }
+ if (!ServletFileUpload.isMultipartContent(request)) {
+ response.sendRedirect("badimage.jspx");
+ return;
+ }
- ServletFileUpload upload = new ServletFileUpload(diskFileItemFactory);
- upload.setFileSizeMax(MAX_IMAGE_SIZE);
+ ServletFileUpload upload = new ServletFileUpload(diskFileItemFactory);
+ upload.setFileSizeMax(MAX_IMAGE_SIZE);
- // Parse the request
- try {
- for (FileItem item : (List<FileItem>) upload.parseRequest(request)) {
- if (!item.isFormField()) {
- if (item.getSize() <= MAX_IMAGE_SIZE) {
+ // Parse the request
+ try {
+ for (FileItem item : (List<FileItem>) upload.parseRequest(request)) {
+ if (!item.isFormField()) {
+ if (item.getSize() <= MAX_IMAGE_SIZE) {
log.info("Decoding uploaded file");
- InputStream is = item.getInputStream();
- try {
- processStream(is, response);
- } finally {
- is.close();
- }
- } else {
- throw new ServletException("File is too large: " + item.getSize());
- }
- break;
- }
- }
- } catch (FileUploadException fue) {
- response.sendRedirect("badimage.jspx");
- }
-
- }
-
- private static void processStream(InputStream is, HttpServletResponse response) throws IOException {
- BufferedImage image = ImageIO.read(is);
- if (image == null) {
- response.sendRedirect("badimage.jspx");
- return;
- }
-
- Reader reader = new MultiFormatReader();
- Result result;
- try {
- result = reader.decode(new BufferedImageMonochromeBitmapSource(image), HINTS);
- } catch (ReaderException re) {
- log.info("DECODE FAILED: " + re.toString());
- response.sendRedirect("notfound.jspx");
- return;
- }
-
- response.setContentType("text/plain");
- response.setCharacterEncoding("UTF-8");
- Writer out = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
- try {
- out.write(result.getText());
- } finally {
- out.close();
- }
- }
-
- private static boolean isSizeOK(HttpMessage getResponse) {
+ InputStream is = item.getInputStream();
+ try {
+ processStream(is, response);
+ } finally {
+ is.close();
+ }
+ } else {
+ throw new ServletException("File is too large: " + item.getSize());
+ }
+ break;
+ }
+ }
+ } catch (FileUploadException fue) {
+ response.sendRedirect("badimage.jspx");
+ }
+
+ }
+
+ private static void processStream(InputStream is, HttpServletResponse response) throws IOException {
+ BufferedImage image = ImageIO.read(is);
+ if (image == null) {
+ response.sendRedirect("badimage.jspx");
+ return;
+ }
+
+ Reader reader = new MultiFormatReader();
+ Result result;
+ try {
+ result = reader.decode(new BufferedImageMonochromeBitmapSource(image), HINTS);
+ } catch (ReaderException re) {
+ log.info("DECODE FAILED: " + re.toString());
+ response.sendRedirect("notfound.jspx");
+ return;
+ }
+
+ response.setContentType("text/plain");
+ response.setCharacterEncoding("UTF-8");
+ Writer out = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
+ try {
+ out.write(result.getText());
+ } finally {
+ out.close();
+ }
+ }
+
+ private static boolean isSizeOK(HttpMessage getResponse) {
Header lengthHeader = getResponse.getLastHeader("Content-Length");
- if (lengthHeader != null) {
- long length = Long.parseLong(lengthHeader.getValue());
- if (length > MAX_IMAGE_SIZE) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public void destroy() {
- log.config("DecodeServlet shutting down...");
+ if (lengthHeader != null) {
+ long length = Long.parseLong(lengthHeader.getValue());
+ if (length > MAX_IMAGE_SIZE) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void destroy() {
+ log.config("DecodeServlet shutting down...");
emailTimer.cancel();
}
import javax.servlet.Filter;\r
import javax.servlet.FilterChain;\r
import javax.servlet.FilterConfig;\r
+import javax.servlet.ServletContext;\r
import javax.servlet.ServletException;\r
import javax.servlet.ServletRequest;\r
import javax.servlet.ServletResponse;\r
-import javax.servlet.ServletContext;\r
import javax.servlet.http.HttpServletResponse;\r
import java.io.IOException;\r
import java.net.InetAddress;\r
import java.net.UnknownHostException;\r
+import java.util.Collection;\r
import java.util.Collections;\r
import java.util.HashSet;\r
import java.util.Set;\r
import java.util.Timer;\r
import java.util.TimerTask;\r
-import java.util.Collection;\r
\r
/**\r
* @author Sean Owen\r
*/\r
public final class DoSFilter implements Filter {\r
\r
- private static final int MAX_ACCESSES_PER_IP_PER_TIME = 10;\r
- private static final long MAX_ACCESS_INTERVAL_MSEC = 10L * 1000L;\r
- private static final long UNBAN_INTERVAL_MSEC = 60L * 60L * 1000L;\r
+ private static final int MAX_ACCESSES_PER_IP_PER_TIME = 10;\r
+ private static final long MAX_ACCESS_INTERVAL_MSEC = 10L * 1000L;\r
+ private static final long UNBAN_INTERVAL_MSEC = 60L * 60L * 1000L;\r
\r
- private final IPTrie numRecentAccesses;\r
- private final Timer timer;\r
- private final Set<String> bannedIPAddresses;\r
- private final Collection<String> manuallyBannedIPAddresses;\r
- private ServletContext context;\r
+ private final IPTrie numRecentAccesses;\r
+ private final Timer timer;\r
+ private final Set<String> bannedIPAddresses;\r
+ private final Collection<String> manuallyBannedIPAddresses;\r
+ private ServletContext context;\r
\r
- public DoSFilter() {\r
- numRecentAccesses = new IPTrie();\r
- timer = new Timer("DosFilter reset timer");\r
- bannedIPAddresses = Collections.synchronizedSet(new HashSet<String>());\r
- manuallyBannedIPAddresses = new HashSet<String>();\r
- }\r
+ public DoSFilter() {\r
+ numRecentAccesses = new IPTrie();\r
+ timer = new Timer("DosFilter reset timer");\r
+ bannedIPAddresses = Collections.synchronizedSet(new HashSet<String>());\r
+ manuallyBannedIPAddresses = new HashSet<String>();\r
+ }\r
\r
- public void init(FilterConfig filterConfig) {\r
- context = filterConfig.getServletContext();\r
- String bannedIPs = filterConfig.getInitParameter("bannedIPs");\r
- if (bannedIPs != null) {\r
- for (String ip : bannedIPs.split(",")) {\r
- manuallyBannedIPAddresses.add(ip.trim());\r
- }\r
- }\r
- timer.scheduleAtFixedRate(new ResetTask(), 0L, MAX_ACCESS_INTERVAL_MSEC);\r
- timer.scheduleAtFixedRate(new UnbanTask(), 0L, UNBAN_INTERVAL_MSEC);\r
+ public void init(FilterConfig filterConfig) {\r
+ context = filterConfig.getServletContext();\r
+ String bannedIPs = filterConfig.getInitParameter("bannedIPs");\r
+ if (bannedIPs != null) {\r
+ for (String ip : bannedIPs.split(",")) {\r
+ manuallyBannedIPAddresses.add(ip.trim());\r
+ }\r
}\r
+ timer.scheduleAtFixedRate(new ResetTask(), 0L, MAX_ACCESS_INTERVAL_MSEC);\r
+ timer.scheduleAtFixedRate(new UnbanTask(), 0L, UNBAN_INTERVAL_MSEC);\r
+ }\r
\r
- public void doFilter(ServletRequest request,\r
- ServletResponse response,\r
- FilterChain chain) throws IOException, ServletException {\r
- if (isBanned(request)) {\r
- HttpServletResponse servletResponse = (HttpServletResponse) response;\r
- servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);\r
- } else {\r
- chain.doFilter(request, response);\r
- }\r
+ public void doFilter(ServletRequest request,\r
+ ServletResponse response,\r
+ FilterChain chain) throws IOException, ServletException {\r
+ if (isBanned(request)) {\r
+ HttpServletResponse servletResponse = (HttpServletResponse) response;\r
+ servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);\r
+ } else {\r
+ chain.doFilter(request, response);\r
}\r
+ }\r
\r
- private boolean isBanned(ServletRequest request) {\r
- String remoteIPAddressString = request.getRemoteAddr();\r
- if (bannedIPAddresses.contains(remoteIPAddressString) ||\r
- manuallyBannedIPAddresses.contains(remoteIPAddressString)) {\r
- return true;\r
- }\r
- InetAddress remoteIPAddress;\r
- try {\r
- remoteIPAddress = InetAddress.getByName(remoteIPAddressString);\r
- } catch (UnknownHostException uhe) {\r
- context.log("Can't determine host from: " + remoteIPAddressString + "; assuming banned");\r
- return true;\r
- }\r
- if (numRecentAccesses.incrementAndGet(remoteIPAddress) > MAX_ACCESSES_PER_IP_PER_TIME) {\r
- context.log("Possible DoS attack from " + remoteIPAddressString);\r
- bannedIPAddresses.add(remoteIPAddressString);\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public void destroy() {\r
- timer.cancel();\r
- numRecentAccesses.clear();\r
- bannedIPAddresses.clear();\r
+ private boolean isBanned(ServletRequest request) {\r
+ String remoteIPAddressString = request.getRemoteAddr();\r
+ if (bannedIPAddresses.contains(remoteIPAddressString) ||\r
+ manuallyBannedIPAddresses.contains(remoteIPAddressString)) {\r
+ return true;\r
}\r
+ InetAddress remoteIPAddress;\r
+ try {\r
+ remoteIPAddress = InetAddress.getByName(remoteIPAddressString);\r
+ } catch (UnknownHostException uhe) {\r
+ context.log("Can't determine host from: " + remoteIPAddressString + "; assuming banned");\r
+ return true;\r
+ }\r
+ if (numRecentAccesses.incrementAndGet(remoteIPAddress) > MAX_ACCESSES_PER_IP_PER_TIME) {\r
+ context.log("Possible DoS attack from " + remoteIPAddressString);\r
+ bannedIPAddresses.add(remoteIPAddressString);\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
\r
- private final class ResetTask extends TimerTask {\r
- @Override\r
- public void run() {\r
- numRecentAccesses.clear();\r
- }\r
- }\r
+ public void destroy() {\r
+ timer.cancel();\r
+ numRecentAccesses.clear();\r
+ bannedIPAddresses.clear();\r
+ }\r
\r
- private final class UnbanTask extends TimerTask {\r
- @Override\r
- public void run() {\r
- bannedIPAddresses.clear();\r
- }\r
- }\r
+ private final class ResetTask extends TimerTask {\r
+ @Override\r
+ public void run() {\r
+ numRecentAccesses.clear();\r
+ }\r
+ }\r
+\r
+ private final class UnbanTask extends TimerTask {\r
+ @Override\r
+ public void run() {\r
+ bannedIPAddresses.clear();\r
+ }\r
+ }\r
\r
}
\ No newline at end of file
package com.google.zxing.web;
import javax.mail.Authenticator;
+import javax.mail.PasswordAuthentication;
final class EmailAuthenticator extends Authenticator {
this.emailPassword = emailPassword;
}
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(emailUsername, emailPassword);
+ }
+
}
*/\r
final class IPTrie {\r
\r
- private final IPTrieNode root;\r
+ private final IPTrieNode root;\r
\r
- IPTrie() {\r
- root = new IPTrieNode(false);\r
- }\r
+ IPTrie() {\r
+ root = new IPTrieNode(false);\r
+ }\r
\r
- int incrementAndGet(InetAddress ipAddress) {\r
- byte[] octets = ipAddress.getAddress();\r
- synchronized (root) {\r
- IPTrieNode current = root;\r
- int max = octets.length - 1;\r
- for (int offset = 0; offset < max; offset++) {\r
- int index = 0xFF & octets[offset];\r
- IPTrieNode child = current.children[index];\r
- if (child == null) {\r
- child = new IPTrieNode(offset == max - 1);\r
- current.children[index] = child;\r
- }\r
- current = child;\r
- }\r
- int index = 0xFF & octets[max];\r
- current.values[index]++;\r
- return current.values[index];\r
- }\r
- }\r
+ int incrementAndGet(InetAddress ipAddress) {\r
+ byte[] octets = ipAddress.getAddress();\r
+ synchronized (root) {\r
+ IPTrieNode current = root;\r
+ int max = octets.length - 1;\r
+ for (int offset = 0; offset < max; offset++) {\r
+ int index = 0xFF & octets[offset];\r
+ IPTrieNode child = current.children[index];\r
+ if (child == null) {\r
+ child = new IPTrieNode(offset == max - 1);\r
+ current.children[index] = child;\r
+ }\r
+ current = child;\r
+ }\r
+ int index = 0xFF & octets[max];\r
+ current.values[index]++;\r
+ return current.values[index];\r
+ }\r
+ }\r
\r
- void clear() {\r
- synchronized (root) {\r
- Arrays.fill(root.children, null);\r
- }\r
- }\r
+ void clear() {\r
+ synchronized (root) {\r
+ Arrays.fill(root.children, null);\r
+ }\r
+ }\r
\r
- private static final class IPTrieNode {\r
- final IPTrieNode[] children;\r
- final int[] values;\r
- private IPTrieNode(boolean terminal) {\r
- if (terminal) {\r
- children = null;\r
- values = new int[256];\r
- } else {\r
- children = new IPTrieNode[256];\r
- values = null;\r
- }\r
- }\r
- }\r
+ private static final class IPTrieNode {\r
+ final IPTrieNode[] children;\r
+ final int[] values;\r
+\r
+ private IPTrieNode(boolean terminal) {\r
+ if (terminal) {\r
+ children = null;\r
+ values = new int[256];\r
+ } else {\r
+ children = new IPTrieNode[256];\r
+ values = null;\r
+ }\r
+ }\r
+ }\r
\r
}
\ No newline at end of file
limitations under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.1">
-<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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head><title>No Barcode Found</title></head>
-<body>
-<p><b>Bad URL</b></p>
-<p>The image you uploaded could not be decoded, or was too large. Go "Back" in your browser and try another image.</p>
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-788492-5";
-urchinTracker();
-</script>
-</body>
-</html>
+ <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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>No Barcode Found</title>
+ </head>
+ <body>
+ <p>
+ <b>Bad URL</b>
+ </p>
+ <p>The image you uploaded could not be decoded, or was too large. Go "Back" in your browser and try another
+ image.
+ </p>
+ <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>
+ </body>
+ </html>
</jsp:root>
limitations under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.1">
-<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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head><title>No Barcode Found</title></head>
-<body>
-<p><b>Bad URL</b></p>
-<p>You didn't specify a URL, or the URL was not valid, or did not return an image. Go "Back" in your browser and try again.</p>
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-788492-5";
-urchinTracker();
-</script>
-</body>
-</html>
+ <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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>No Barcode Found</title>
+ </head>
+ <body>
+ <p>
+ <b>Bad URL</b>
+ </p>
+ <p>You didn't specify a URL, or the URL was not valid, or did not return an image. Go "Back" in your browser and
+ try again.
+ </p>
+ <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>
+ </body>
+ </html>
</jsp:root>
limitations under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.1">
-<jsp:output
- omit-xml-declaration="false" doctype-root-element="html"
- doctype-public="-//W3C//DTD XHTML 1.1//EN"
- doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
-<jsp:directive.page contentType="text/html" session="false"/>
-<jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head><title>ZXing Decoder Online</title></head>
-<body>
-
-<h1>ZXing Decoder Online</h1>
-
-<p><b>Under Construction</b>: This is a simple page that will let you decode a 1D or 2D barcode found
-in an image online. Enter a URL below.</p>
-
-<form action="decode" method="get">
-<p><input type="text" size="50" name="u"/><input type="submit"/></p>
-</form>
-
-<p>Or try uploading a file:</p>
-
-<form action="decode" method="post" enctype="multipart/form-data" >
-<p><input type="file" size="50" name="f"/><input type="submit"/></p>
-</form>
-
-<p>See the <a href="http://code.google.com/p/zxing">project page</a> for details.</p>
-
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-788492-5";
-urchinTracker();
-</script>
-
-</body>
-</html>
+ <jsp:output
+ omit-xml-declaration="false" doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.1//EN"
+ doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
+ <jsp:directive.page contentType="text/html" session="false"/>
+ <jsp:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>ZXing Decoder Online</title>
+ </head>
+ <body>
+
+ <h1>ZXing Decoder Online</h1>
+
+ <p><b>Under Construction</b>: This is a simple page that will let you decode a 1D or 2D barcode found
+ in an image online. Enter a URL below.
+ </p>
+
+ <form action="decode" method="get">
+ <p>
+ <input type="text" size="50" name="u"/>
+ <input type="submit"/>
+ </p>
+ </form>
+
+ <p>Or try uploading a file:</p>
+
+ <form action="decode" method="post" enctype="multipart/form-data">
+ <p>
+ <input type="file" size="50" name="f"/>
+ <input type="submit"/>
+ </p>
+ </form>
+
+ <p>See the
+ <a href="http://code.google.com/p/zxing">project page</a>
+ for details.
+ </p>
+
+ <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>
+
+ </body>
+ </html>
</jsp:root>
limitations under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.1">
-<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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head><title>Download ZXing Reader</title></head>
-<body>
-<p><strong>Welcome to zxing!</strong></p>
-<p><a href="BarcodeReader.jad">Download</a> the ZXing Barcode Reader.</p>
-<p><strong>Having problems with the regular version?</strong></p>
-<p><a href="BarcodeReaderBasic.jad">Download</a> the ZXing Barcode Reader Basic version.</p>
-<p><strong>An Android client is available for the curious:</strong></p>
-<p><a href="BarcodeReader.apk">Download</a> the Android client.</p>
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-788492-5";
-urchinTracker();
-</script>
-</body>
-</html>
+ <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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>Download ZXing Reader</title>
+ </head>
+ <body>
+ <p>
+ <strong>Welcome to zxing!</strong>
+ </p>
+ <p>
+ <a href="BarcodeReader.jad">Download</a>
+ the ZXing Barcode Reader.
+ </p>
+ <p>
+ <strong>Having problems with the regular version?</strong>
+ </p>
+ <p>
+ <a href="BarcodeReaderBasic.jad">Download</a>
+ the ZXing Barcode Reader Basic version.
+ </p>
+ <p>
+ <strong>An Android client is available for the curious:</strong>
+ </p>
+ <p>
+ <a href="BarcodeReader.apk">Download</a>
+ the Android client.
+ </p>
+ <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>
+ </body>
+ </html>
</jsp:root>
limitations under the License.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns="http://www.w3.org/1999/xhtml" version="2.1">
-<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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head><title>No Barcode Found</title></head>
-<body>
-<p><b>No Barcode Found</b></p>
-<p>No barcode was found in this image. Either it did not contain a barcode, or did not contain one in a
-supported format, or the software was simply unable to find it. Go "Back" in your browser and try another image.</p>
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-788492-5";
-urchinTracker();
-</script>
-</body>
-</html>
+ <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:scriptlet>response.setHeader("Cache-Control", "public");</jsp:scriptlet>
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>No Barcode Found</title>
+ </head>
+ <body>
+ <p>
+ <b>No Barcode Found</b>
+ </p>
+ <p>No barcode was found in this image. Either it did not contain a barcode, or did not contain one in a
+ supported format, or the software was simply unable to find it. Go "Back" in your browser and try another image.
+ </p>
+ <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>
+ </body>
+ </html>
</jsp:root>