[jboss-user] [JBoss Seam] - Re: Two browser tabs : basic question

dkane do-not-reply at jboss.com
Fri Dec 21 04:09:15 EST 2007


"pete.muir at jboss.org" wrote : You don't need to use @RequestParamater with page parameters. Take a look at seamdiscs to see how they should be used.

I see no "param" tags in pages.xml of seamDISKS example (Seam 2.0) . 

In seamSPACE , I see the following : 

pages.xml : 

<page view-id="/comment.xhtml" login-required="true">
  |       <restrict/>
  |       
  |       <param name="name" value="#{selectedMember.memberName}"/>
  |       <param name="blogId" value="#{selectedBlog.blogId}"/>
  |       
  |       <navigation from-action="#{blog.saveComment}">
  |         <redirect view-id="/blogentry.xhtml"/>
  |       </navigation>
  | </page>


The target page, blogentry.xhtml , uses BlogAction component. 
In BlogAction.java : 

@RequestParameter
  | private Integer blogId;
  | ......
  | 
  | @Factory("selectedBlog") 
  | @Begin(join=true)
  | public void getBlog()
  | {     
  |       try
  |       {
  |          selectedBlog = (MemberBlog) entityManager.createQuery(
  |            "from MemberBlog b where b.blogId = :blogId and b.member.memberName = :memberName")
  |            .setParameter("blogId",blogId)
  |            .setParameter("memberName", name)
  |            .getSingleResult();
  |       } 
  | ....
  | }
  | 

I.e. blogId is passed as @RequestParameter and then used to retreive current blog. Exactly the same approach I am trying to implement. Anything wrong ? 





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114913#4114913

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114913



More information about the jboss-user mailing list