[JBoss Seam] - Need help to understand what I'm doing
by fredatwork
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
18 years, 8 months
[JBoss Messaging] - Re: Message stranded in cluster
by chip_schoch
Ok, I finally got everything up and running on JBAS 4.2.2.GA and JBM 1.4.0.SP1.
I use a ClusteredConnectionFactory to push messages to a clustered queue, and it is round-robining them to the partial queues as expected.
Each of the services consuming these messages pushes another message on to another clustered queue using XAConnectionFactory, which results in each node pushing the message to its own partial queue.
The consumers of these messages are non-clustered windows servers that are both connected to one of the nodes in the cluster using the ClusteredConnectionFactory available through ha-jndi.
I expected the messagesucker to move messages from the node with no consumer to the node with consumers but it is not. Is this because those message were pushed using the XAConnectionFactory instead of the ClusteredConnectionFactory?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106420#4106420
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106420
18 years, 8 months
[JBoss Seam] - Problem with DataModel and s:link
by vfaid
Hello,
I'm using Seam 2.0GA.
I've a rich:dataTable that displays the values of a DataModel outjected from a "search" component. Each row defines a s:link with an action that triggers the call to a select method of an "info" component throuh a pageflow. The two components are in a the same conversation scope.
It works fine if I use h:commandLink or h:commandButton but if i use s:link, it fails. The value passed to the select method is always the one that's attached to first row I've clicked.
Here are the code snippets.
SearchBookingAction:
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("search")
| @Restrict("#{identity.loggedIn}")
| public class SearchBookingAction implements SearchBooking {
|
| @In
| private EntityManager arsEntityManager;
|
| @DataModel
| private List<Booking> bookings;
|
| private String pnr;
| private String flightNumber;
| private Date flightDate;
|
| public void search()
| {
| Query query = arsEntityManager.createQuery(...);
| bookings = query.getResultList();
| }
|
| ....
| }
|
BookingInfoAction:
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("info")
| public class BookingInfoAction implements BookingInfo {
|
| @In
| private EntityManager arsEntityManager;
|
| private Booking booking;
|
| private List<Flight> departureFlights;
| private List<Flight> returnFlights;
|
| public void selectBooking(Booking booking) {
| this.booking = booking;
| }
|
| public boolean populate() {
| log.info("info.populate() called with: "+booking.getPnr());
| if (booking == null)
| return false;
| departureFlights = selectDepartureFlights();
| returnFlights = selectDepartureFlights();
| return true;
| }
|
| ...
| }
|
search.xhtml:
| <rich:dataTable value="#{bookings}" var="currentBooking" >
| <rich:column>
| <f:facet name="header">#{messages['asr.list.pnr']}</f:facet>
| #{currentBooking.pnr}
| </rich:column>
| <rich:column>
| <f:facet name="header">#{messages['asr.list.name']}</f:facet>
| #{currentBooking.masterName}
| </rich:column>
| <rich:column>
| <f:facet name="header">#{messages['asr.list.flightnum']}</f:facet>
| #{currentBooking.masterFlightNumber}
| </rich:column>
| ...
| <rich:column>
| <f:facet name="header">#{messages['asr.list.viewheader']} :</f:facet>
| <s:link value="#{messages['asr.list.view']}" action="view" />
| </rich:column>
| </rich:dataTable>
|
bo.jpdl.xml:
| <start-page name="displaySearchBookingForm" view-id="/search.xhtml">
| <redirect/>
| ...
| <transition name="view" to="populateBookingInfo">
| <action expression="#{info.selectBooking(currentBooking)}" />
| </transition>
| </start-page>
|
| <decision name="populateBookingInfo" expression="#{info.populate()}">
| <transition name="true" to="displayBooking"/>
| <transition name="false" to="displayFindBookingForm"/>
| </decision>
|
| <page name="displayBooking" view-id="/booking.xhtml" back="enabled">
| <redirect/>
| ...
| </page>
|
| ...
|
Any ideas why it works with a h:commandButton or h:commandLink and not a s:link?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106404#4106404
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106404
18 years, 8 months