Author: ivaynberg
Date: Mon Aug 15 16:08:44 2011
New Revision: 1157900

URL: http://svn.apache.org/viewvc?rev=1157900&view=rev
Log:
some initial weld examples that currently do not use weld but demonstrate a 
wicket bug with session propagation

Added:
    wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ApplicationCounter.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationCounter.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.html
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.html
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.html
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/Counter.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.html
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.html
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldApplication.java
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.html
   (with props)
    
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.java
   (with props)
    wicket/trunk/wicket-examples/src/main/resources/META-INF/beans.xml   (with 
props)
Modified:
    wicket/trunk/wicket-examples/pom.xml
    
wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/homepage/HomePage.html
    wicket/trunk/wicket-examples/src/main/webapp/WEB-INF/web.xml

Modified: wicket/trunk/wicket-examples/pom.xml
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/pom.xml?rev=1157900&r1=1157899&r2=1157900&view=diff
==============================================================================
--- wicket/trunk/wicket-examples/pom.xml (original)
+++ wicket/trunk/wicket-examples/pom.xml Mon Aug 15 16:08:44 2011
@@ -43,6 +43,10 @@
                        <groupId>org.apache.wicket</groupId>
                        <artifactId>wicket-guice</artifactId>
                </dependency>
+               <!--dependency>
+                       <groupId>org.apache.wicket</groupId>
+                       <artifactId>wicket-weld</artifactId>
+               </dependency-->
                <dependency>
                        <groupId>org.apache.wicket</groupId>
                        <artifactId>wicket-jmx</artifactId>

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ApplicationCounter.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ApplicationCounter.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ApplicationCounter.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ApplicationCounter.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,23 @@
+/*
+ * 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.wicket.examples.weld;
+
+
+//@ApplicationScoped
+public class ApplicationCounter extends Counter
+{
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ApplicationCounter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationCounter.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationCounter.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationCounter.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationCounter.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,23 @@
+/*
+ * 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.wicket.examples.weld;
+
+
+//@ConversationScoped
+public class ConversationCounter extends Counter
+{
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationCounter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.html?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.html
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.html
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,15 @@
+<wicket:extend>
+
+       <p>This page demonstrates conversational propagation between
+               non-bookmarkable pages. Below is a counter that is
+               conversation-scoped. Click increment a couple of times and then 
click
+               the 'Continue to next page', the counter value should persist 
on the
+               next page.</p>
+       <p>
+               Current counter value is: <span wicket:id="count">100</span> <a
+                       wicket:id="increment">increment</a>
+       </p>
+       <p>
+               <a wicket:id="next">Continue to next page</a>
+       </p>
+</wicket:extend>
\ No newline at end of file

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,68 @@
+/*
+ * 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.wicket.examples.weld;
+
+import java.util.UUID;
+
+import org.apache.wicket.MetaDataKey;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+public class ConversationPage1 extends ExamplePage
+{
+       public static MetaDataKey<String> KEY = new MetaDataKey<String>()
+       {
+       };
+
+       // @Inject
+       ConversationCounter counter = new ConversationCounter();
+
+       // @Inject
+       // Conversation conversation;
+
+       public ConversationPage1()
+       {
+               // make the conversation long running
+               // conversation.begin();
+
+               getSession().setMetaData(KEY, UUID.randomUUID().toString());
+               System.out.println("1:" + getSession().getMetaData(KEY));
+
+               add(new Label("count", new PropertyModel(this, 
"counter.count")));
+
+               add(new Link<Void>("increment")
+               {
+                       @Override
+                       public void onClick()
+                       {
+                               counter.increment();
+                               System.out.println("1:" + 
getSession().getMetaData(KEY));
+                       }
+               });
+
+               add(new Link<Void>("next")
+               {
+                       @Override
+                       public void onClick()
+                       {
+                               setResponsePage(new ConversationPage2());
+                               System.out.println("1:" + 
getSession().getMetaData(KEY));
+                       }
+               });
+       }
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage1.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.html?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.html
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.html
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,18 @@
+<wicket:extend>
+
+       <p>
+               This page was reached via a non-bookmarkable link so 
conversation was propagated. 
+               Notice the conversational counter injected into this page has 
the same value as in the 
+               previous page, this is because it is the same counter 
instance.</p>
+       <p>
+       <p>
+               The 'Continue to next page' link below is a bookmarkable link. 
Conversations do not propagate
+               across bookmarkable links, so the counter on the next page will 
have the starting value of zero.
+       </p>
+               Current counter value is: <span wicket:id="count">100</span> <a
+                       wicket:id="increment">increment</a>
+       </p>
+       <p>
+               <a wicket:id="next">Continue to next page</a>
+       </p>
+</wicket:extend>
\ No newline at end of file

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,46 @@
+/*
+ * 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.wicket.examples.weld;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+public class ConversationPage2 extends ExamplePage
+{
+       // @Inject
+       ConversationCounter counter = new ConversationCounter();
+
+       public ConversationPage2()
+       {
+               System.out.println("2:" + 
getSession().getMetaData(ConversationPage1.KEY));
+               add(new Label("count", new PropertyModel(this, 
"counter.count")));
+
+               add(new Link<Void>("increment")
+               {
+                       @Override
+                       public void onClick()
+                       {
+                               System.out.println("2:" + 
getSession().getMetaData(ConversationPage1.KEY));
+                               counter.increment();
+                       }
+               });
+
+               add(new BookmarkablePageLink<Void>("next", 
ConversationPage3.class));
+       }
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage2.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.html?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.html
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.html
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,9 @@
+<wicket:extend>
+       <p>
+               This page was reached via a bookmarkable link, which means the 
conversation
+               was not propagated. This is why the counter has a fresh value 
of zero.
+       </p>
+       <p>
+               Current counter value is: <span wicket:id="count">100</span>
+       </p>
+</wicket:extend>
\ No newline at end of file

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,33 @@
+/*
+ * 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.wicket.examples.weld;
+
+import javax.inject.Inject;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.PropertyModel;
+
+public class ConversationPage3 extends ExamplePage
+{
+       @Inject
+       ConversationCounter counter;
+
+       public ConversationPage3()
+       {
+               add(new Label("count", new PropertyModel(this, 
"counter.count")));
+       }
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ConversationPage3.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/Counter.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/Counter.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/Counter.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/Counter.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,35 @@
+/*
+ * 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.wicket.examples.weld;
+
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class Counter implements Serializable
+{
+       private AtomicInteger counter = new AtomicInteger();
+
+       public int getCount()
+       {
+               return counter.get();
+       }
+
+       public void increment()
+       {
+               counter.incrementAndGet();
+       }
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/Counter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.html?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.html
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.html
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,16 @@
+<html xmlns:wicket="http://wicket.apache.org";>
+<head>
+    <title>Wicket Examples - JBoss Weld</title>
+    <link rel="stylesheet" type="text/css" href="style.css"/>
+</head>
+<body>
+
+    <span wicket:id = "mainNavigation"/>
+    
+    <h2>Welcome to JBoss Weld Examples</h2>
+
+    <p><wicket:link><a href="WeldHomePage.html">[go back]</a></wicket:link></p>
+
+       <wicket:child/>
+</body>
+</html>

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,24 @@
+/*
+ * 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.wicket.examples.weld;
+
+import org.apache.wicket.examples.WicketExamplePage;
+
+public abstract class ExamplePage extends WicketExamplePage
+{
+
+}
\ No newline at end of file

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/ExamplePage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.html?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.html
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.html
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,14 @@
+<wicket:extend>
+
+<p>
+       This page demonstrates injection of a application-scoped Counter service
+</p>
+<p>
+       Current counter value is: <span wicket:id="count">100</span>
+       <a wicket:id="increment">increment</a>
+</p>
+<p>
+       Notice as you navigate away and come back to this page the value 
persists or is larger because it is shared across all users in application scope
+</p>
+
+</wicket:extend>
\ No newline at end of file

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,41 @@
+/*
+ * 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.wicket.examples.weld;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.PropertyModel;
+
+public class InjectionPage extends ExamplePage
+{
+       // @Inject
+       ApplicationCounter counter = new ApplicationCounter();
+
+       public InjectionPage()
+       {
+               add(new Label("count", new PropertyModel(this, 
"counter.count")));
+
+               add(new Link<Void>("increment")
+               {
+                       @Override
+                       public void onClick()
+                       {
+                               counter.increment();
+                       }
+               });
+       }
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/InjectionPage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldApplication.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldApplication.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldApplication.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldApplication.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,38 @@
+/*
+ * 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.wicket.examples.weld;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.protocol.http.WebApplication;
+
+public class WeldApplication extends WebApplication
+{
+
+       @Override
+       public Class<? extends Page> getHomePage()
+       {
+               return WeldHomePage.class;
+       }
+
+       @Override
+       protected void init()
+       {
+               super.init();
+               // new WeldConfiguration().configure(this);
+       }
+
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldApplication.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.html?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.html
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.html
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,14 @@
+<wicket:extend>
+
+<wicket:link>
+<ul>
+       <li>
+               <a href="InjectionPage.html">Injection Example</a>
+       </li>
+       <li>
+               <a href="ConversationPage1.html">Conversation Propagation 
Example</a>
+       </li>
+</ul>
+</wicket:link>
+
+</wicket:extend>
\ No newline at end of file

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.java?rev=1157900&view=auto
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.java
 (added)
+++ 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.java
 Mon Aug 15 16:08:44 2011
@@ -0,0 +1,25 @@
+/*
+ * 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.wicket.examples.weld;
+
+
+public class WeldHomePage extends ExamplePage
+{
+       public WeldHomePage()
+       {
+       }
+}

Propchange: 
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/weld/WeldHomePage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: wicket/trunk/wicket-examples/src/main/resources/META-INF/beans.xml
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/resources/META-INF/beans.xml?rev=1157900&view=auto
==============================================================================
--- wicket/trunk/wicket-examples/src/main/resources/META-INF/beans.xml (added)
+++ wicket/trunk/wicket-examples/src/main/resources/META-INF/beans.xml Mon Aug 
15 16:08:44 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans 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/beans_1_0.xsd";>
+</beans>
\ No newline at end of file

Propchange: wicket/trunk/wicket-examples/src/main/resources/META-INF/beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/homepage/HomePage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/homepage/HomePage.html?rev=1157900&r1=1157899&r2=1157900&view=diff
==============================================================================
--- 
wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/homepage/HomePage.html
 (original)
+++ 
wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/homepage/HomePage.html
 Mon Aug 15 16:08:44 2011
@@ -57,6 +57,7 @@
         
                <tr class="section"><td align="right"><a 
href="spring">spring</a></td><td> - Demonstrates integration options with the 
Spring framework.</td></tr>
                <tr><td align="right"><a href="guice">guice</a></td><td> - 
Integration with the Google Guice IoC container.</td></tr>
+               <tr><td align="right"><a href="weld">weld</a></td><td> - 
Integration with JBoss Weld</td></tr>
                <tr><td align="right"><a href="velocity">velocity</a></td><td> 
- Shows a Velocity panel in action.</td></tr>
                <tr><td align="right"><a href="mappers">Wicket 1.5 Request 
Mappers</a></td><td> - Shows custom request mappers.</td></tr>
                <tr><td align="right"><a href="events">Wicket 1.5 
Events</a></td><td> - Shows inter-component events</td></tr>

Modified: wicket/trunk/wicket-examples/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/webapp/WEB-INF/web.xml?rev=1157900&r1=1157899&r2=1157900&view=diff
==============================================================================
--- wicket/trunk/wicket-examples/src/main/webapp/WEB-INF/web.xml (original)
+++ wicket/trunk/wicket-examples/src/main/webapp/WEB-INF/web.xml Mon Aug 15 
16:08:44 2011
@@ -778,4 +778,29 @@
                <session-timeout>5</session-timeout>
        </session-config>
        
+       
+       
+       <!-- [WICKET WELD] -->
+       
+       <listener>
+               <!-- listener to initialize weld in a servlet environment -->
+               
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+       </listener>
+       
+       <filter>
+               <filter-name>WeldApplication</filter-name>
+               
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+               <init-param>
+                 <param-name>applicationClassName</param-name>
+                 
<param-value>org.apache.wicket.examples.weld.WeldApplication</param-value>
+               </init-param>
+       </filter>
+       
+       <filter-mapping>
+               <filter-name>WeldApplication</filter-name>
+        <url-pattern>/weld/*</url-pattern>
+       </filter-mapping>
+       
+       <!-- [/WICKET WELD] -->
+       
 </web-app>


Reply via email to