[jboss-user] [JBoss Seam] - View and Business logic: 2x calling method for #{bean.items}
miloslav.vlach
do-not-reply at jboss.com
Fri May 18 10:06:01 EDT 2007
I have problem with this:
I have one action with one method: find
this method starts with log message "finding" and prepare data for the view. After this method prepare data, the view should be displayed. But when I call the page in log appear the log from getItems method. But this method shloud be called after the business logic ends.
Can somebody tell me where is the problem? When I call this action at first, all work ok. But the second request invoke first the getItems method.
| <ui:repeat var="i" value="#{searchResult.items}">
| <h:outputText value="#{i.date}" /> <h:outputText value="#{i.pi.position}" /> <h:outputText value="#{i.pi.page}" /> (#{i.pi.phrase})<br/>
| </ui:repeat>
|
| public String find() {
| log.info("finding: #0, #1", searchEntity.getKeyword(), searchEntity.getUrl());
|
| ....
| log.info("search finished");
|
| log.info("session object: #0", searchResult);
|
| log.info("adding results to the session variable");
| if (searchResult != null) {
| Date d = new Date();
|
| searchResult.add(d, ...);
| searchResult.add(d, ...);
| }
| log.info("results added");
| return null;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046822#4046822
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046822
More information about the jboss-user
mailing list