Author: shane.bryzak(a)jboss.com
Date: 2008-01-21 19:45:29 -0500 (Mon, 21 Jan 2008)
New Revision: 7170
Removed:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogLocal.java
Modified:
trunk/examples/seamspace/resources/WEB-INF/pages.xml
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogAction.java
Log:
replaced request parameters with page parameters
Modified: trunk/examples/seamspace/resources/WEB-INF/pages.xml
===================================================================
--- trunk/examples/seamspace/resources/WEB-INF/pages.xml 2008-01-21 23:49:10 UTC (rev
7169)
+++ trunk/examples/seamspace/resources/WEB-INF/pages.xml 2008-01-22 00:45:29 UTC (rev
7170)
@@ -19,8 +19,8 @@
<page view-id="/comment.xhtml" login-required="true">
<restrict/>
- <param name="name"
value="#{selectedMember.memberName}"/>
- <param name="blogId" value="#{selectedBlog.blogId}"/>
+ <param name="name" value="#{blog.name}"/>
+ <param name="blogId" value="#{blog.blogId}"/>
<navigation from-action="#{blog.saveComment}">
<redirect view-id="/blogentry.xhtml"/>
@@ -57,6 +57,8 @@
</page>
<page view-id="/blogentry.xhtml">
+ <param name="name" value="#{blog.name}"/>
+ <param name="blogId" value="#{blog.blogId}"/>
</page>
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogAction.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogAction.java 2008-01-21
23:49:10 UTC (rev 7169)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogAction.java 2008-01-22
00:45:29 UTC (rev 7170)
@@ -5,37 +5,28 @@
import java.util.ArrayList;
import java.util.Date;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import org.jboss.seam.annotations.Begin;
-import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.web.RequestParameter;
+import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.security.Restrict;
-@Stateful
+@Scope(CONVERSATION)
@Name("blog")
-public class BlogAction implements BlogLocal
+public class BlogAction
{
- @RequestParameter
private String name;
-
- @RequestParameter
private Integer blogId;
@In
private EntityManager entityManager;
- @In(required = false)
- Member selectedMember;
-
@In(required = false) @Out(required = false)
private MemberBlog selectedBlog;
@@ -102,6 +93,23 @@
entityManager.persist(selectedBlog);
}
- @Remove @Destroy
- public void destroy() { }
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public Integer getBlogId()
+ {
+ return blogId;
+ }
+
+ public void setBlogId(Integer blogId)
+ {
+ this.blogId = blogId;
+ }
}
Deleted: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogLocal.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogLocal.java 2008-01-21
23:49:10 UTC (rev 7169)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/BlogLocal.java 2008-01-22
00:45:29 UTC (rev 7170)
@@ -1,17 +0,0 @@
-package org.jboss.seam.example.seamspace;
-
-import javax.ejb.Local;
-
-@Local
-public interface BlogLocal
-{
- void getBlog();
-
- void createComment();
- void saveComment();
-
- void createEntry();
- void saveEntry();
-
- void destroy();
-}
Show replies by date