
|
If you were logged in you would be able to see more operations.
|
|
|
|
From a user mailing list posting by Viswanath <v_ramineni AT hotmail.com>, following up on earlier mailing list conversations:
==========
Hi Craig,
Now that I have subscribed to Shale user group, I am posting this issue again.
Just to make sure that I am not using older version of Shale libraries, I have downloaded shale-framework-20060713.zip and tried, same problem. This is what I did, to reproduce the issue in usecases project. ( I am not able to post code from my project because of lot of dependencies on EJBs/Database)
I downloaded the latest usecases zip (07/14/2006). Unzipped the war file into a directory, created a project in eclipse, added the java source files, built and deployed it into JBOSS and it ran fine. Added the following code at the end of org/apache/shale/usecases/locale/Select.java overriding the "do-nothing" init() from ActionViewController.
public void init()
{
System.out.println("Select.java - Init - PostBack Value: " + Boolean.toString(isPostBack()));
}
redeployed and ran. The console output when I click on "Select Language" link
15:20:27,515 INFO [STDOUT] Select.java - Init - PostBack Value: false
15:20:27,515 INFO [STDOUT] Select.java - Init - PostBack Value: false
and on sumbit (when I click on "Go" )
15:20:33,546 INFO [STDOUT] Select.java - Init - PostBack Value: false
15:20:33,562 INFO [STDOUT] Select.java - Init - PostBack Value: true
My environment is :
OS : Windows XP Home
JBOSS 4.0.4 Patch1 with Tomcat 5.5
JRE : 1.5.0_06
Eclipse 3.1.1
Thanks
Vish
==========
I was able to reproduce this with latest trunk bits, using the default testing configuration (MyFaces, Tomcat 5.5). It's clearly a bug in how init and destroy method callbacks are being triggered for view controllers, most likely related to the fact that the mechanism for this was recently changed.
|
|
Description
|
From a user mailing list posting by Viswanath <v_ramineni AT hotmail.com>, following up on earlier mailing list conversations:
==========
Hi Craig,
Now that I have subscribed to Shale user group, I am posting this issue again.
Just to make sure that I am not using older version of Shale libraries, I have downloaded shale-framework-20060713.zip and tried, same problem. This is what I did, to reproduce the issue in usecases project. ( I am not able to post code from my project because of lot of dependencies on EJBs/Database)
I downloaded the latest usecases zip (07/14/2006). Unzipped the war file into a directory, created a project in eclipse, added the java source files, built and deployed it into JBOSS and it ran fine. Added the following code at the end of org/apache/shale/usecases/locale/Select.java overriding the "do-nothing" init() from ActionViewController.
public void init()
{
System.out.println("Select.java - Init - PostBack Value: " + Boolean.toString(isPostBack()));
}
redeployed and ran. The console output when I click on "Select Language" link
15:20:27,515 INFO [STDOUT] Select.java - Init - PostBack Value: false
15:20:27,515 INFO [STDOUT] Select.java - Init - PostBack Value: false
and on sumbit (when I click on "Go" )
15:20:33,546 INFO [STDOUT] Select.java - Init - PostBack Value: false
15:20:33,562 INFO [STDOUT] Select.java - Init - PostBack Value: true
My environment is :
OS : Windows XP Home
JBOSS 4.0.4 Patch1 with Tomcat 5.5
JRE : 1.5.0_06
Eclipse 3.1.1
Thanks
Vish
==========
I was able to reproduce this with latest trunk bits, using the default testing configuration (MyFaces, Tomcat 5.5). It's clearly a bug in how init and destroy method callbacks are being triggered for view controllers, most likely related to the fact that the mechanism for this was recently changed.
|
Show » |
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#422609 |
Mon Jul 17 03:17:18 UTC 2006 |
craigmcc |
[SHALE-220] Resolve problems with the init() and destroy() methods being
called twice on a ViewController.
There were actually two related problems:
* The init() and destroy() methods were indeed being called twice.
This was due to a change in the implemented support for these calls
(the logic was migrated from ViewViewHandler to LifecycleListener),
without accounting for the fact that the view controller instance was
also being added as a reqeust scope attribute under the VIEW_RENDERED
constant as well (which triggered the init/destroy behavior again).
Fixed by storing the name of the corresponding managed bean, rather
than the managed bean itself.
* The postBack property was not correctly initialized before the
init() method was called, although it was set correctly before
the preprocess() method was called (if it was, indeed, a post back).
Fixed by initializing the postBack property in the constructor of
AbstractViewController, and ensuring that the relevant request scope
attribute was initialized before the managed bean was created.
While messing around with this functionality, I also took the
opportunity to isolate manifest constants that are internal to the
implementation out of org.apache.shale.view.Constants and into a private
package, so as to not confuse developers about what an application can
rely on.
Also, added a system integration test to the Use Cases example
application, to ensure the proper calling sequence of view controller
lifecycle events.
|
| Files Changed |
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/Constants.java
ADD
/shale/trunk/shale-apps/shale-usecases/src/main/java/org/apache/shale/usecases/view/TestViewController.java
ADD
/shale/trunk/shale-apps/shale-usecases/src/main/webapp/view/test.jsp
ADD
/shale/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/ViewControllerTestCase.java
ADD
/shale/trunk/shale-apps/shale-usecases/src/main/webapp/view
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/component/Subview.java
MODIFY
/shale/trunk/shale-clay/src/main/java/org/apache/shale/clay/faces/ClayViewHandler.java
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java
MODIFY
/shale/trunk/shale-apps/shale-usecases/src/main/webapp/WEB-INF/faces-config.xml
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/faces/LifecycleListener.java
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/faces/ExceptionHandlerImpl.java
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/AbstractViewController.java
ADD
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/faces/FacesConstants.java
MODIFY
/shale/trunk/shale-core/src/main/java/org/apache/shale/view/faces/ViewPhaseListener.java
|
|