Odd issue with weblogic
efbiaiinzinz May 29, 2008 10:43 PMWe have a big project done using seam. Production deployment is to weblogic 10
When we deploy it in glassfish server, everything works fine.
But in weblogic, there apperas some odd issue with pagecontext.
We have a searchbox and searchresults. Searchbox is in page scope, search results are also put to page scope for less memory usage.
When user clicks searchbutton, action method search() gets called on searchbox.
Which in turn calls method from conversation scoped class that creates a query based on posted values, and puts the query into page scope with Contexts.getPageContext().set(searchResults
, results);
@Name("searchBox") @Scope(ScopeType.PAGE) @BypassInterceptors class SearchBox { --snip-- @Begin(join = true) public String search() { --calls a conversation scoped class's method to do a search based on posted values-- //return page location to do a full page refresh return "/path/to/mypage.xhtml"; } --snip-- }
Results are displayed in xhtml with icefaces datatable.
<ice:dataTable id="results" var="resultitem" value="#{searchResults}">--snip--</ice:dataTable>
The problem we're having exactly is like this: user sets some values to searchbox, presses search button, everything is ok. But when user now changes the values in searchbox and does search again, old results are shown at the first page.
When user navigates to second page, everything goes back to normal, page displayed is the second page based on new input values.
When debugging the method called from search(), method that puts the result container into page scope, there was something odd. It first did the search with new values, then called Contexts.removeFromAllContexts(searchResults
);
Then did Contexts.getPageContext().set(searchResults
, results);
Now when I did Contexts.getPageContext().get(searchResults
); it didn't return the value the code just had put there, but instead the result of previous query, although I had just done removefromallcontexts and set the value to something new.
I then tested with unifiedvaluebinding
org.jboss.seam.jsf.UnifiedELValueBinding vb = new org.jboss.seam.jsf.UnifiedELValueBinding("#{searchEstateResults}"); Object test = vb.getValue(FacesContext.getCurrentInstance()); vb.setValue(FacesContext.getCurrentInstance(), results); Object test2 = vb.getValue(FacesContext.getCurrentInstance()); Object test3 = Contexts.getPageContext().get("searchResults");
Object test is not same object that was put to pagecontext.
When I do setValue and then GetValue, then object test2 is the value I put there with setvalue.
When I try to get the value from pagecontext, I still get the old value.
Any suggestions or pointers what I may be doing wrong ?
We also use Icefaces 1.7.0 and currently seam without ejb3 support.
The odd part is that this behaviour does not appear when deployed in glassfish :(