mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-02 11:05:29 -04:00
Moving old servlet stuff to sandbox.
This commit is contained in:
parent
73fc08f8c1
commit
0b23d9f6c2
@ -21,6 +21,7 @@
|
||||
|
||||
<modules>
|
||||
<module>sandbox-common</module>
|
||||
<module>sandbox-servlet</module>
|
||||
<module>sandbox-swing</module>
|
||||
</modules>
|
||||
|
||||
@ -58,6 +59,12 @@
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.servlet</groupId>
|
||||
<artifactId>servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.swing</groupId>
|
||||
<artifactId>swing-core</artifactId>
|
||||
|
90
sandbox/sandbox-servlet/pom.xml
Normal file
90
sandbox/sandbox-servlet/pom.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
~ Copyright (c) 2011, Harald Kuhr
|
||||
~ All rights reserved.
|
||||
~
|
||||
~ Redistribution and use in source and binary forms, with or without
|
||||
~ modification, are permitted provided that the following conditions are met:
|
||||
~ * Redistributions of source code must retain the above copyright
|
||||
~ notice, this list of conditions and the following disclaimer.
|
||||
~ * Redistributions in binary form must reproduce the above copyright
|
||||
~ notice, this list of conditions and the following disclaimer in the
|
||||
~ documentation and/or other materials provided with the distribution.
|
||||
~ * Neither the name "TwelveMonkeys" nor the
|
||||
~ names of its contributors may be used to endorse or promote products
|
||||
~ derived from this software without specific prior written permission.
|
||||
~
|
||||
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
~ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
~ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
~ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
~ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
~ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
~ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
~ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
~ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
~ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.twelvemonkeys.sandbox</groupId>
|
||||
<artifactId>sandbox</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>sandbox-servlet</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>TwelveMonkeys :: Sandbox :: Servlet</name>
|
||||
<description>
|
||||
The TwelveMonkeys Servlet Sandbox. Experimental stuff. Old stuff that didn't cut it.
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common-lang</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common-io</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.common</groupId>
|
||||
<artifactId>common-image</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.servlet</groupId>
|
||||
<artifactId>servlet</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.14</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -37,7 +37,6 @@ import java.io.IOException;
|
||||
*/
|
||||
public abstract class Droplet extends HttpServlet implements JspFragment {
|
||||
|
||||
// Copy doc
|
||||
public abstract void service(PageContext pPageContext)
|
||||
throws ServletException, IOException;
|
||||
|
@ -1,10 +1,8 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.droplet;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Oparam (Open parameter)
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.droplet;
|
||||
|
||||
import javax.servlet.ServletException;
|
@ -27,8 +27,6 @@ import com.twelvemonkeys.servlet.jsp.taglib.BodyReaderTag;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.tagext.BodyTag;
|
||||
import javax.servlet.jsp.tagext.Tag;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -38,7 +36,7 @@ import java.io.IOException;
|
||||
* @author Thomas Purcell (CSC Australia)
|
||||
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
|
||||
* @author last modified by $Author: haku $
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/droplet/taglib/OparamTag.java#1 $
|
||||
* @version $Id: jsp/droplet/taglib/OparamTag.java#1 $
|
||||
*/
|
||||
public class OparamTag extends BodyReaderTag {
|
||||
|
||||
@ -78,13 +76,11 @@ public class OparamTag extends BodyReaderTag {
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the tag implemented by this class is enclosed by an {@code
|
||||
* IncludeTag}. If the tag is not enclosed by an
|
||||
* {@code IncludeTag} then a {@code JspException} is thrown.
|
||||
* Ensure that the tag implemented by this class is enclosed by an {@code IncludeTag}.
|
||||
* If the tag is not enclosed by an {@code IncludeTag} then a {@code JspException} is thrown.
|
||||
*
|
||||
* @return If this tag is enclosed within an {@code IncludeTag}, then
|
||||
* the default return value from this method is the {@code
|
||||
* TagSupport.EVAL_BODY_TAG} value.
|
||||
* @return If this tag is enclosed within an {@code IncludeTag}, then the default return value
|
||||
* from this method is the {@code TagSupport.EVAL_BODY_TAG} value.
|
||||
*
|
||||
* @throws JspException
|
||||
*/
|
||||
@ -102,15 +98,14 @@ public class OparamTag extends BodyReaderTag {
|
||||
includeTag.addParameter(parameterName, new Oparam(subpage.getName()));
|
||||
|
||||
// if ! subpage.exist || jsp newer than subpage, write new
|
||||
File jsp = new File(pageContext.getServletContext()
|
||||
.getRealPath(request.getServletPath()));
|
||||
File jsp = new File(pageContext.getServletContext().getRealPath(request.getServletPath()));
|
||||
|
||||
if (!subpage.exists() || jsp.lastModified() > subpage.lastModified()) {
|
||||
return BodyTag.EVAL_BODY_BUFFERED;
|
||||
return EVAL_BODY_BUFFERED;
|
||||
}
|
||||
|
||||
// No need to evaluate body again!
|
||||
return Tag.SKIP_BODY;
|
||||
return SKIP_BODY;
|
||||
}
|
||||
|
||||
/**
|
@ -17,10 +17,8 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.droplet.taglib;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.jsp.tagext.*;
|
||||
import javax.servlet.jsp.tagext.TagData;
|
||||
import javax.servlet.jsp.tagext.TagExtraInfo;
|
||||
|
||||
/**
|
||||
* TagExtraInfo for ValueOf.
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
@ -70,7 +70,7 @@ import java.util.StringTokenizer;
|
||||
*
|
||||
* @author Harald Kuhr
|
||||
*
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/CSVToTableTag.java#1 $
|
||||
* @version $Id: jsp/taglib/CSVToTableTag.java#1 $
|
||||
*/
|
||||
public class CSVToTableTag extends ExBodyTagSupport {
|
||||
public final static String TAB = "\t";
|
@ -14,14 +14,18 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.jsp.tagext.*;
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import javax.servlet.jsp.tagext.BodyTagSupport;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Enumeration;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* This is the class that should be extended by all jsp pages that do use their
|
||||
@ -30,7 +34,7 @@ import javax.servlet.jsp.tagext.*;
|
||||
* @author Thomas Purcell (CSC Australia)
|
||||
* @author Harald Kuhr
|
||||
*
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExBodyTagSupport.java#1 $
|
||||
* @version $Id: jsp/taglib/ExBodyTagSupport.java#1 $
|
||||
*/
|
||||
|
||||
public class ExBodyTagSupport extends BodyTagSupport implements ExTag {
|
@ -15,12 +15,13 @@
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.jsp.tagext.*;
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.Tag;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* This interface contains a lot of helper methods for simplifying common
|
||||
@ -28,7 +29,7 @@ import javax.servlet.jsp.tagext.*;
|
||||
*
|
||||
* @author Harald Kuhr
|
||||
*
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTag.java#1 $
|
||||
* @version $Id: jsp/taglib/ExTag.java#1 $
|
||||
*/
|
||||
|
||||
public interface ExTag extends Tag {
|
@ -15,14 +15,18 @@
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.jsp.tagext.*;
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import javax.servlet.jsp.tagext.TagSupport;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Enumeration;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* This is the class that should be extended by all jsp pages that don't use
|
||||
@ -32,7 +36,7 @@ import javax.servlet.jsp.tagext.*;
|
||||
* @author Thomas Purcell (CSC Australia)
|
||||
* @author Harald Kuhr
|
||||
*
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#1 $
|
||||
* @version $Id: jsp/taglib/ExTagSupport.java#1 $
|
||||
*/
|
||||
|
||||
public class ExTagSupport extends TagSupport implements ExTag {
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
import javax.servlet.jsp.*;
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
import com.twelvemonkeys.util.convert.Converter;
|
@ -1,10 +1,8 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.tagext.BodyTag;
|
||||
|
||||
/**
|
||||
* This tag truncates all consecutive whitespace in sequence inside its body,
|
||||
@ -26,7 +24,7 @@ public class TrimWhiteSpaceTag extends ExBodyTagSupport {
|
||||
*/
|
||||
|
||||
public int doStartTag() throws JspException {
|
||||
return BodyTag.EVAL_BODY_BUFFERED;
|
||||
return EVAL_BODY_BUFFERED;
|
||||
}
|
||||
|
||||
/**
|
@ -16,21 +16,17 @@ package com.twelvemonkeys.servlet.jsp.taglib;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.jsp.tagext.*;
|
||||
import javax.xml.transform.*;
|
||||
import javax.xml.transform.stream.*;
|
||||
|
||||
import com.twelvemonkeys.servlet.jsp.*;
|
||||
|
||||
/**
|
||||
* This tag performs XSL Transformations (XSLT) on a given XML document or its
|
||||
* body content.
|
||||
*
|
||||
* @author Harald Kuhr
|
||||
*
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java#1 $
|
||||
* @version $Id: jsp/taglib/XMLTransformTag.java#1 $
|
||||
*/
|
||||
|
||||
public class XMLTransformTag extends ExBodyTagSupport {
|
||||
@ -86,11 +82,11 @@ public class XMLTransformTag extends ExBodyTagSupport {
|
||||
throw new JspException(ioe.getMessage(), ioe);
|
||||
}
|
||||
|
||||
return Tag.SKIP_BODY;
|
||||
return SKIP_BODY;
|
||||
}
|
||||
|
||||
// ...else process the body
|
||||
return BodyTag.EVAL_BODY_BUFFERED;
|
||||
return EVAL_BODY_BUFFERED;
|
||||
}
|
||||
|
||||
/**
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib.logic;
|
||||
|
||||
import javax.servlet.jsp.tagext.*;
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.jsp.taglib.logic;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
@ -20,7 +20,7 @@ import java.util.Set;
|
||||
* <p/>
|
||||
*
|
||||
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
|
||||
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-servlet/src/main/java/com/twelvemonkeys/servlet/log4j/Log4JContextWrapper.java#1 $
|
||||
* @version $Id: log4j/Log4JContextWrapper.java#1 $
|
||||
*/
|
||||
final class Log4JContextWrapper implements ServletContext {
|
||||
// TODO: Move to sandbox
|
@ -1,10 +0,0 @@
|
||||
/**
|
||||
* Dynamo Droplet-like functionality for JSP.
|
||||
*
|
||||
* This package is early beta, not for commercial use! :-)
|
||||
* Read: The interfaces and classes in this package (and subpackages) will be
|
||||
* developed and modified for a while.
|
||||
*
|
||||
* TODO: Insert taglib-descriptor here?
|
||||
*/
|
||||
package com.twelvemonkeys.servlet.jsp.droplet;
|
@ -1,4 +0,0 @@
|
||||
/**
|
||||
* JSP support.
|
||||
*/
|
||||
package com.twelvemonkeys.servlet.jsp;
|
@ -1,4 +0,0 @@
|
||||
/**
|
||||
* The TwelveMonkeys common TagLib.
|
||||
*/
|
||||
package com.twelvemonkeys.servlet.jsp.taglib;
|
Loading…
x
Reference in New Issue
Block a user