[jboss-user] [JBoss Seam] - Need help to understand what I'm doing

fredatwork do-not-reply at jboss.com
Tue Nov 20 10:29:24 EST 2007


Hello,

I need some help to understand better the usage of the session context.

I've got a bean in the session context with a property 'scroller' that will be bound to a Richfaces datascroller component :
@Stateful(name="EqtWebEquitySelector")
  | @Name("equitySelector")
  | @Scope(ScopeType.SESSION)
  | @TransactionAttribute(TransactionAttributeType.SUPPORTS)
  | public class EqtWebEquitySelectorBean implements EqtWebEquitySelectorLocal {
  | 
  | 	.../...
  | 
  | 	// Scroller
  | 	private HtmlDatascroller scroller;
  | 
  | 	/**
  | 	 * @see com.rubis.web.equity.EqtWebEquitySelectorLocal#getScroller()
  | 	 */
  | 	public HtmlDatascroller getScroller() {
  | 		return scroller;
  | 	}
  | 
  | 	/**
  | 	 * @see com.rubis.web.equity.EqtWebEquitySelectorLocal#setScroller(org.richfaces.component.html.HtmlDatascroller)
  | 	 */
  | 	public void setScroller(HtmlDatascroller scroller) {
  | 		this.scroller = scroller;
  | 	}
  | 	.../...
  | }
  | 

Its interface is :

package com.rubis.web.equity;
  | 
  | import org.richfaces.component.html.HtmlDatascroller;
  | 
  | public interface EqtWebEquitySelectorLocal {
  | 	.../...
  | 	
  | 	public HtmlDatascroller getScroller();
  | 	
  | 	public void setScroller(HtmlDatascroller scroller);
  | 	
  | 	.../...
  | 	
  | }

A page binds the property 'scroller' to the 'equitySelector' component :

  | <h:inputText id="equitySearchCriteria" 
  | 	size="10"
  | 	value="#{equitySelector.searchCriteria}">
  | 	<a4j:support 
  | 		id="equitySearchCriteriaSupport"
  | 		event="onkeyup" 
  | 		actionListener="#{equitySelector.search}" 
  | 		reRender="equityListArea"
  | 		requestDelay="375"
  | 		timeout="3000" />
  | </h:inputText>
  | 			
  | <a4j:outputPanel id="equityListArea">
  | 	<rich:dataTable id="equityTable" .../... >
  | 		.../...
  | 	</rich:dataTable>
  | 	<rich:datascroller 
  | 		for="equityTable"
  | 		actionListener="#{equitySelector.scroll}"
  | 		binding="#{equitySelector.scroller}"
  | 	/>
  | 

If a remove the @Scope(ScopeType.SESSION) annotation from the bean, the JSF rendering of the page fails. It says that 'equitySelector' is null. 

If I remove the binding to the 'scroller' property, the rest of the page works, that is 'equitySelector' is found (it is used appropriately some other places in the page).

Why is this ?

Why do I have to load the session context ?

Is there w way to use some other scope type for the bean than SESSION ?  
I would like not to overload my http session with stateful data ? Can I use the PAGE scope type instead ?
 
Fred

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

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



More information about the jboss-user mailing list