myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1402076 - in /myfaces/extensions/scripting/trunk: extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/engine/ extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/script...
Date Thu, 25 Oct 2012 09:58:52 GMT
Author: werpu
Date: Thu Oct 25 09:58:51 2012
New Revision: 1402076

URL: http://svn.apache.org/viewvc?rev=1402076&view=rev
Log:
EXTSCRIPT-178: fixing the base engine, since tomcat returns a null
path on "./" adding context.xmls wherever needed
added scripting paths for the testing example
fixing the startu process since spring behaves
differently in startup compared to jetty.
This should also resolve a likely issue with
big irons where paths are not getting picked up.

Added:
    myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/META-INF/
    myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/META-INF/context.xml
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/META-INF/
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/META-INF/context.xml
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/META-INF/
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/META-INF/context.xml
    myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/META-INF/
    myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/META-INF/context.xml
Modified:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/engine/BaseEngine.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoaderListener.java
    myfaces/extensions/scripting/trunk/extscript-examples/pom.xml
    myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml
    myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/engine/BaseEngine.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/engine/BaseEngine.java?rev=1402076&r1=1402075&r2=1402076&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/engine/BaseEngine.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/engine/BaseEngine.java
Thu Oct 25 09:58:51 2012
@@ -237,9 +237,11 @@ public abstract class BaseEngine
         if (pathSeparatedList.equals(defaultValue))
         {
             URL resource = ClassUtils.getContextClassLoader().getResource("./");
+            //in war deployments a problem can occur if not all paths are set
+            String path = (resource == null)? "bogusPath" : resource.getPath();
             try
             {
-                pathSeparatedList = FilenameUtils.normalize(URLDecoder.decode(resource.getPath(),
+                pathSeparatedList = FilenameUtils.normalize(URLDecoder.decode(path,
                         Charset.defaultCharset().toString())
                         + "../.." + defaultValue);
             }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java?rev=1402076&r1=1402075&r2=1402076&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoader.java
Thu Oct 25 09:58:51 2012
@@ -53,21 +53,7 @@ public class CompilationAwareContextLoad
         wac.refresh();
 
         //we now init the scripting system
-        try
-        {
-            //the reloading listener also is the marker to avoid double initialisation
-            //after the container is kickstarted
-            if (servletContext.getAttribute(INITIALIZED) == null)
-            {
-                //probably already started
-                StartupServletContextPluginChainLoader.startup(servletContext);
-                servletContext.setAttribute(INITIALIZED, Boolean.TRUE);
-            }
-        }
-        catch (IOException e)
-        {
-            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
-        }
+
 
         Class contextClass = determineContextClass(servletContext);
         if (!ConfigurableWebApplicationContext.class.isAssignableFrom(contextClass))

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoaderListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoaderListener.java?rev=1402076&r1=1402075&r2=1402076&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoaderListener.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-spring/src/main/java/org/apache/myfaces/extensions/scripting/spring/context/CompilationAwareContextLoaderListener.java
Thu Oct 25 09:58:51 2012
@@ -19,10 +19,12 @@
 
 package org.apache.myfaces.extensions.scripting.spring.context;
 
+import org.apache.myfaces.extensions.scripting.jsf.startup.StartupServletContextPluginChainLoader;
 import org.springframework.web.context.ContextLoader;
 import org.springframework.web.context.ContextLoaderListener;
 
 import javax.servlet.ServletContextEvent;
+import java.io.IOException;
 
 /**
  * @author Werner Punz (latest modification by $Author$)
@@ -40,6 +42,22 @@ public class CompilationAwareContextLoad
     @Override
     public void contextInitialized(ServletContextEvent event)
     {
+        try
+        {
+            //the reloading listener also is the marker to avoid double initialisation
+            //after the container is kickstarted
+            if (event.getServletContext().getAttribute("StartupInitialized") == null)
+            {
+                //probably already started
+                StartupServletContextPluginChainLoader.startup(event.getServletContext());
+                event.getServletContext().setAttribute("StartupInitialized", Boolean.TRUE);
+            }
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
+
         super.contextInitialized(event);
     }
 

Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/META-INF/context.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/META-INF/context.xml?rev=1402076&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/META-INF/context.xml
(added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/META-INF/context.xml
Thu Oct 25 09:58:51 2012
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+</Context>
\ No newline at end of file

Added: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/META-INF/context.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/META-INF/context.xml?rev=1402076&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/META-INF/context.xml
(added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/META-INF/context.xml
Thu Oct 25 09:58:51 2012
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+</Context>
\ No newline at end of file

Added: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/META-INF/context.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/META-INF/context.xml?rev=1402076&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/META-INF/context.xml
(added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/META-INF/context.xml
Thu Oct 25 09:58:51 2012
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+</Context>
\ No newline at end of file

Modified: myfaces/extensions/scripting/trunk/extscript-examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/pom.xml?rev=1402076&r1=1402075&r2=1402076&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/pom.xml Thu Oct 25 09:58:51 2012
@@ -28,6 +28,9 @@
         Examples Meta Project, see the subprojects
         for starting various parts of ext-scripting
     </description>
+    <properties>
+        <tomcat7-maven-plugin.version>2.0</tomcat7-maven-plugin.version>
+    </properties>
 
     <parent>
         <groupId>org.apache.myfaces.extensions.scripting</groupId>
@@ -36,18 +39,29 @@
     </parent>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/extensions/scripting/tags/extscript-root-1.0.4/extscript-examples
+        <connection>
+            scm:svn:http://svn.apache.org/repos/asf/myfaces/extensions/scripting/tags/extscript-root-1.0.4/extscript-examples
         </connection>
         <developerConnection>
             scm:svn:https://svn.apache.org/repos/asf/myfaces/extensions/scripting/tags/extscript-root-1.0.4/extscript-examples
         </developerConnection>
-        <url>http://svn.apache.org/viewvc/myfaces/extensions/scripting/tags/extscript-root-1.0.4/extscript-examples</url>
+        <url>http://svn.apache.org/viewvc/myfaces/extensions/scripting/tags/extscript-root-1.0.4/extscript-examples
+        </url>
     </scm>
 
 
     <build>
         <plugins>
             <plugin>
+                <groupId>org.apache.tomcat.maven</groupId>
+                <artifactId>tomcat7-maven-plugin</artifactId>
+                <version>${tomcat7-maven-plugin.version}</version>
+                <configuration>
+                    <path>/</path>
+                    <port>9080</port>
+                </configuration>
+            </plugin>
+            <plugin>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-maven-plugin</artifactId>
                 <version>8.1.2.v20120308</version>
@@ -68,8 +82,6 @@
                 <artifactId>tomcat-maven-plugin</artifactId>
                 <version>1.0</version>
             </plugin>
-
-
         </plugins>
     </build>
     <modules>

Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml?rev=1402076&r1=1402075&r2=1402076&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml Thu Oct 25
09:58:51 2012
@@ -79,14 +79,19 @@
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring</artifactId>
-            <version>2.5.6</version>
+            <version>${spring.version}</version>
         </dependency>
 
         <dependency>
             <groupId>cglib</groupId>
             <artifactId>cglib</artifactId>
-            <version>2.1_3</version>
+            <version>${cglib.version}</version>
         </dependency>
     </dependencies>
 
+    <properties>
+        <spring.version>2.5.6</spring.version>
+        <cglib.version>2.1_3</cglib.version>
+    </properties>
+
 </project>
\ No newline at end of file

Added: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/META-INF/context.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/META-INF/context.xml?rev=1402076&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/META-INF/context.xml
(added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/META-INF/context.xml
Thu Oct 25 09:58:51 2012
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+</Context>
\ No newline at end of file

Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml?rev=1402076&r1=1402075&r2=1402076&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
Thu Oct 25 09:58:51 2012
@@ -32,6 +32,59 @@
     </context-param>
 
     <context-param>
+        <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+            of the deployment dir
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.java.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/java
+        </param-value>
+    </context-param>
+
+    <context-param>
+            <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+                of the deployment dir
+            </description>
+            <param-name>org.apache.myfaces.extensions.scripting.ruby.LOADER_PATHS</param-name>
+            <param-value>
+                /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/ruby
           </param-value>
+        </context-param>
+
+    <!--
+    <context-param>
+        <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+            of the deployment dir
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.groovy.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/groovy
+        </param-value>
+    </context-param>
+
+    <context-param>
+        <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+            of the deployment dir
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.scala.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/scala
+        </param-value>
+    </context-param>
+
+
+
+
+    <context-param>
+        <description>resource paths for our custom JSF2 resource resolver</description>
+        <param-name>org.apache.myfaces.extensions.scripting.resources.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/blog-example/src/main/webapp
+        </param-value>
+    </context-param>
+    -->
+
+
+    <context-param>
         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
         <param-value>server</param-value>
     </context-param>
@@ -61,10 +114,11 @@
     </context-param>
 
     <!-- Listener, to allow Jetty serving MyFaces apps -->
+    <!--
     <listener>
         <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
     </listener>
-
+    -->
     <listener>
         <!--
         <listener-class>



Mime
View raw message