I've been having problem with bookmark pages for a couple of days and hope to get someone's help here.
let me describe my scenario in short. Say I can list many shops and each shop can sell many items. Each shop has got its own id, so they can be accessed by a bookmakable url (e.g. http://abcd.com/shop.seam?id=22), or through our search utilities. When shop.seam is being accessed, I've defined an action method in pages.xml and this method outject a list of items that shop sells. In shop.xhtml, all the items are showed with a checkbox beside. Users can tick the items they want, and finally click on "Buy now" to buy their interested items. By looking at seam blog example, here are 2 ways to implement this function I've tried so far: 1. Define a stateful bean. Here is what this bean looks like: | @Stateful | @Name("shopAction") | public class ShopAction ... | { | @RequestParameter | String id; | | @In(scope=Conversation) | @Out(scope=Conversation) | List items; | | public void showShop(){ | items=getShopItems(id); | } | | public String buyNow(){ | List selectedItem=getSelected(items); | .... | } | } | Using stateful bean pretty much solved my problem but with 2 pitfalls: 1) when shop.seam is redirected from my search bean, the url would have conversationId=xx included (e.g. http://abcd.com/shop.seam?id=22&converstationId=2). this is not right since user doesn't wanna bookmark the conversation ID. 2) Each time when user browses a shop's items, there will be a new conversation created. This is not performant enough because users quite often browse a lot of shops before buying anything. 2. My second approach is to use stateless bean. This is how seam blog example implemented the bookmark function. With this approach, I can't find a way to pass items between showShop() and buyNow() since Stateless bean can't manipulate conversational stuffs. Has anyone experienced this problem before? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945267#3945267 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945267 ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
