
|
If you were logged in you would be able to see more operations.
|
|
|
WebWork
Created: 20/Oct/06 07:41 AM
Updated: 06/Feb/07 11:13 PM
|
|
| Component/s: |
Dispatch
|
| Affects Version/s: |
2.2.4
|
| Fix Version/s: |
2.2.5
|
|
|
( not sure this is in correct component )
There is a bug in PicoObjectFactory in buildBean().
Registering not found action/object in the container returned by actionsContaienrFactory is wrong, because
this object remains there for the whole request, and is reused when object of same class is being requested.
This leads to problems with (at least) validators - there will be only one instace for all fields which is quite wrong.
Patch is pretty easy:
if (action == null) {
// The action wasn't registered. Attempt to instantiate it.
MutablePicoContainer container = new DefaultPicoContainer(actionsContainer);
container.registerComponentImplementation(actionClass);
action = container.getComponentInstance(actionClass);
}
( create subcontainer just for instantiation of this one object )
This error was taken over from nanocontainer ( I will fix it there too, as I have commit
privileges )
|
|
Description
|
( not sure this is in correct component )
There is a bug in PicoObjectFactory in buildBean().
Registering not found action/object in the container returned by actionsContaienrFactory is wrong, because
this object remains there for the whole request, and is reused when object of same class is being requested.
This leads to problems with (at least) validators - there will be only one instace for all fields which is quite wrong.
Patch is pretty easy:
if (action == null) {
// The action wasn't registered. Attempt to instantiate it.
MutablePicoContainer container = new DefaultPicoContainer(actionsContainer);
container.registerComponentImplementation(actionClass);
action = container.getComponentInstance(actionClass);
}
( create subcontainer just for instantiation of this one object )
This error was taken over from nanocontainer ( I will fix it there too, as I have commit
privileges )
|
Show » |
|
though this should be vanilla one. ( but this bug is in nanowar - so mine )
Rule of thumb is: if it is not your container, do not touch it but
create subcontainer ;)