Author: cziegeler
Date: Wed Dec 5 07:52:01 2007
New Revision: 601375
URL: http://svn.apache.org/viewvc?rev=601375&view=rev
Log:
Make sling core runnable with servlet api 2.5 environments.
Modified:
incubator/sling/trunk/sling/core/pom.xml
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/helper/SlingServletContext.java
Modified: incubator/sling/trunk/sling/core/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/pom.xml?rev=601375&r1=601374&r2=601375&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/pom.xml (original)
+++ incubator/sling/trunk/sling/core/pom.xml Wed Dec 5 07:52:01 2007
@@ -113,9 +113,16 @@
<artifactId>org.apache.sling.jcr.resource</artifactId>
<version>2.0.0-incubator-SNAPSHOT</version>
</dependency>
+ <!-- We explicitly use version 2.5 of the servlet spec here as we have
+ an own implementation of the ServletContext which should be usable
+ in 2.5 environments.
+ However, Sling is fully runnable with servlet api 2.4.
+ -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
Modified:
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/helper/SlingServletContext.java
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/helper/SlingServletContext.java?rev=601375&r1=601374&r2=601375&view=diff
==============================================================================
---
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/helper/SlingServletContext.java
(original)
+++
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/helper/SlingServletContext.java
Wed Dec 5 07:52:01 2007
@@ -324,7 +324,13 @@
return Collections.enumeration(Collections.emptyList());
}
+ /** Returns the context path of the web application. (Servlet API 2.5) */
+ public String getContextPath() {
+ return getServletContext().getContextPath();
+ }
+
// ---------- internal
-----------------------------------------------------
+
/**
* Returns the real servlet context of the servlet container in which the