[Seaside] Seaside and AspectS. Infinite redirection loop when aspect
signals an error
Vaidas Didzbalis
vaidasd at lnb.lt
Mon Mar 22 14:19:22 UTC 2004
Hello,
I have before acpect installed on rendering method. Everything is nice
until aspect fires an error. Rendering method does two loops. Funny that
if names of parameters in both closures are the same -- error handling
works correctly!
to test:
install AspectS,
file in code attached,
install aspect:
| aspect |
MyPresenter initialize.
aspect _ MyPresenterAspect new.
aspect install.
point your internet browser now to
http://localhost:8080/seaside/MyPresenter/
it will get to infinite redirection loop.
to uninstall aspect, evaluate
aspect uninstall.
aspect _ nil.
Vaidas
-------------- next part --------------
WAComponent subclass: #MyPresenter
instanceVariableNames: 'generateError '
classVariableNames: ''
poolDictionaries: ''
category: 'MySeasidePresenter'!
!MyPresenter methodsFor: 'as yet unclassified' stamp: 'vd 3/19/2004 12:46'!
renderContentOn: html
1 to: 2 do: [:each | html paragraph: 'Some text'].
1 to: 2 do: [:e | html paragraph: 'Some other text']
"if local variable in last line named <each>, - it works correctly!!"! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
MyPresenter class
instanceVariableNames: ''!
!MyPresenter class methodsFor: 'as yet unclassified' stamp: 'vd 3/19/2004 12:32'!
initialize
"self initialize"
(self registerAsApplication: 'MyPresenter')
! !
AsAspect subclass: #MyPresenterAspect
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'MySeasidePresenter'!
!MyPresenterAspect methodsFor: 'as yet unclassified' stamp: 'vd 3/19/2004 12:30'!
adviceSignalErrorTest
^ AsBeforeAfterAdvice
qualifier: (AsAdviceQualifier attributes: { #receiverClassSpecific. })
pointcut: [OrderedCollection
with: (AsJoinPointDescriptor targetClass: MyPresenter targetSelector: #renderContentOn: )]
beforeBlock: [:receiver :arguments :aspect :client |
Error signal: 'Fire!!']! !
MyPresenter initialize!
More information about the Squeak-dev
mailing list
|