You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/10/25 16:48:33 UTC
svn commit: r829608 - in /incubator/openwebbeans/trunk/samples/jsf2sample:
./ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/webbeans/
src/main/java/org/apache/webbeans/jsf2/ src/main/resources/ src/...
Author: gerdogdu
Date: Sun Oct 25 15:48:32 2009
New Revision: 829608
URL: http://svn.apache.org/viewvc?rev=829608&view=rev
Log:
JSF2 Sample with OpenWebBeans
Added:
incubator/openwebbeans/trunk/samples/jsf2sample/ (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/pom.xml (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/Counter.java (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/CounterBean.java (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/HelloJsfBean.java (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/beans.xml (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/beans.xml (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/lib/
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/web.xml (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/counter.xhtml (with props)
incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/index.jsp (with props)
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Oct 25 15:48:32 2009
@@ -0,0 +1,4 @@
+target
+.classpath
+.project
+.settings
Added: incubator/openwebbeans/trunk/samples/jsf2sample/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/pom.xml?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/pom.xml (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/pom.xml Sun Oct 25 15:48:32 2009
@@ -0,0 +1,108 @@
+ <!--
+
+ 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.
+ -->
+<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>
+ <description>Sample JSF2 Application</description>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.apache.openwebbeans</groupId>
+ <version>1.0.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.openwebbeans.samples</groupId>
+ <artifactId>jsf2sample</artifactId>
+ <packaging>war</packaging>
+ <name>Apache OpenWebBeans :: Sample JSF2 Application</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_3.0_spec</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf</artifactId>
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.0-b13</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.0.0-b13</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.1.2-b04</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>jsf2sample</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <configuration>
+ <contextPath>${build.finalName}</contextPath>
+ <scanIntervalSeconds>3</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/Counter.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/Counter.java?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/Counter.java (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/Counter.java Sun Oct 25 15:48:32 2009
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.jsf2;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER })
+public @interface Counter
+{
+
+}
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/Counter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/CounterBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/CounterBean.java?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/CounterBean.java (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/CounterBean.java Sun Oct 25 15:48:32 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.jsf2;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+@SessionScoped
+public class CounterBean implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private int counter;
+
+ @Produces @Named("count") @Counter
+ public int count()
+ {
+ return counter ++;
+ }
+}
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/CounterBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/HelloJsfBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/HelloJsfBean.java?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/HelloJsfBean.java (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/HelloJsfBean.java Sun Oct 25 15:48:32 2009
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.jsf2;
+
+import javax.enterprise.context.RequestScoped;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("helloBean")
+@RequestScoped
+public class HelloJsfBean implements ActionListener
+{
+ private @Inject @Counter int count;
+
+ /**
+ * @return the count
+ */
+ public int getCount()
+ {
+ return count;
+ }
+
+ /**
+ * @param count the count to set
+ */
+ public void setCount(int count)
+ {
+ this.count = count;
+ }
+
+
+ @Override
+ public void processAction(ActionEvent event) throws AbortProcessingException
+ {
+
+ }
+
+
+}
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/java/org/apache/webbeans/jsf2/HelloJsfBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/beans.xml?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/beans.xml (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/beans.xml Sun Oct 25 15:48:32 2009
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans/>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/resources/META-INF/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/beans.xml?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/beans.xml (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/beans.xml Sun Oct 25 15:48:32 2009
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans/>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/web.xml?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/web.xml Sun Oct 25 15:48:32 2009
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>
+ org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>webbeans</filter-name>
+ <filter-class>org.apache.webbeans.jsf.WebBeansJSFFilter</filter-class>
+ </filter>
+
+ <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>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <filter-mapping>
+ <filter-name>webbeans</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+
+</web-app>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/counter.xhtml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/counter.xhtml?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/counter.xhtml (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/counter.xhtml Sun Oct 25 15:48:32 2009
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.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:h="http://java.sun.com/jsf/html">
+<h:head>
+ <title>JSF2 Ajax with OpenWebBeans Demo</title>
+</h:head>
+<h:body>
+
+ <h3>JSF2 Ajax Demo :: Click <b>Count</b> button to inrease your count</h3>
+
+ <h:form id="form">
+
+ <h:outputScript name="jsf.js" library="javax.faces" target="body"></h:outputScript>
+
+ <div>
+ <h:commandButton id="button1" value="Count..." actionListener="#{helloBean.processAction}"
+ onclick="jsf.ajax.request(this,event, {execute:'form:button1',render:'form:status'});return false;">
+ </h:commandButton>
+
+ </div>
+
+ <div>
+ <h:outputText value="Counter Number : " />
+ <h:outputText value="#{helloBean.count}" id="status" />
+ </div>
+ </h:form>
+
+</h:body>
+</html>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/counter.xhtml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/index.jsp?rev=829608&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/index.jsp (added)
+++ incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/index.jsp Sun Oct 25 15:48:32 2009
@@ -0,0 +1,21 @@
+<!--
+
+ 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>
+<head>
+<meta HTTP-EQUIV="REFRESH" content="0; url=counter.jsf">
+</head>
+</html>
Propchange: incubator/openwebbeans/trunk/samples/jsf2sample/src/main/webapp/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native