example application now transitioned
git-svn-id: https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk@1401683 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/extscript-examples/spring-example/pom.xml b/extscript-examples/spring-example/pom.xml
index da0327b..dd5273f 100644
--- a/extscript-examples/spring-example/pom.xml
+++ b/extscript-examples/spring-example/pom.xml
@@ -50,6 +50,18 @@
<version>${myfaces2.version}</version>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.5.6</version>
+ </dependency>
+
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <version>2.1_3</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml b/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml
index f0da5d4..2cea62c 100644
--- a/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml
+++ b/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml
@@ -1,8 +1,26 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-<faces-config>
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ 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-facesconfig_2_0.xsd"
+ version="2.0">
<application>
<variable-resolver>
diff --git a/extscript-examples/spring-example/src/main/webapp/WEB-INF/spring-config.xml b/extscript-examples/spring-example/src/main/webapp/WEB-INF/spring-config.xml
index 66a95b6..8b4b761 100644
--- a/extscript-examples/spring-example/src/main/webapp/WEB-INF/spring-config.xml
+++ b/extscript-examples/spring-example/src/main/webapp/WEB-INF/spring-config.xml
@@ -5,11 +5,11 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="person" class="at.irian.Person" scope="prototype">
+ <bean id="person" class="org.apache.myfaces.extension.scripting.spring.example.Person" scope="prototype">
<property name="name" value="Lukas Huemer" />
</bean>
- <bean id="greeter" class="at.irian.Greeter">
+ <bean id="greeter" class="org.apache.myfaces.extension.scripting.spring.example.Greeter">
<property name="person" ref="person" />
</bean>
diff --git a/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml b/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
index 36ab771..5cbf9c4 100644
--- a/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
+++ b/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
@@ -1,41 +1,71 @@
+<?xml version="1.0"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ 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_3_0.xsd"
+ version="3.0">
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>
- javax.faces.webapp.FacesServlet
- </servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>
+ javax.faces.webapp.FacesServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>/WEB-INF/spring-config.xml</param-value>
- </context-param>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>/WEB-INF/spring-config.xml</param-value>
+ </context-param>
- <context-param>
- <param-name>sourcePathLocation</param-name>
- <param-value>/home/bhuemer/Projects/spring-scripting/spring-scripting-usecase/src/main/java</param-value>
- </context-param>
+ <context-param>
+ <param-name>sourcePathLocation</param-name>
+ <param-value>/home/bhuemer/Projects/spring-scripting/spring-scripting-usecase/src/main/java</param-value>
+ </context-param>
- <listener>
- <listener-class>
- at.irian.springframework.extensions.scripting.context.CompilationAwareContextLoaderListener
- </listener-class>
- </listener>
+ <!-- Listener, to allow Jetty serving MyFaces apps -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ <!--
+ <listener-class>
+ at.irian.springframework.extensions.scripting.context.CompilationAwareContextLoaderListener
+ </listener-class>
+ -->
+ </listener>
</web-app>
diff --git a/extscript-examples/spring-example/src/main/webapp/home.jsp b/extscript-examples/spring-example/src/main/webapp/home.jsp
deleted file mode 100644
index c7abb6d..0000000
--- a/extscript-examples/spring-example/src/main/webapp/home.jsp
+++ /dev/null
@@ -1,21 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-
-<html>
- <head>
- <title>Scripting Test</title>
- </head>
- <body>
- <f:view>
- <h1>
- <h:outputText value="From JSF: The greeter says '#{greeter.greeting}' to '#{person.name}'."/> <br/>
- <h:outputText value="From JSF: The greeter says '#{greeter.anotherGreeting}'."/> <br/>
- </h1>
-
- <h:form id="helloForm">
- <h:commandButton action="reload" value="Reload" />
- </h:form>
-
- </f:view>
- </body>
-</html>
diff --git a/extscript-examples/spring-example/src/main/webapp/home.xhtml b/extscript-examples/spring-example/src/main/webapp/home.xhtml
new file mode 100644
index 0000000..cffa775
--- /dev/null
+++ b/extscript-examples/spring-example/src/main/webapp/home.xhtml
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ >
+<h:head>
+ <title>Hello World</title>
+</h:head>
+<h:body>
+ <h1>
+ <h:outputText value="From JSF: The greeter says '#{greeter.greeting}' to '#{person.name}'."/> <br/>
+ <h:outputText value="From JSF: The greeter says '#{greeter.anotherGreeting}'."/> <br/>
+ </h1>
+
+ <h:form id="helloForm">
+ <h:commandButton action="reload" value="Reload" />
+ </h:form>
+ </h:body>
+</html>