Is there an easy way to add/override a function to all my Wicket classes
(panels, pages, forms, etc.)? For example, I have a custom session.
Rather than having to cast (MySession)getSession() , I just want
getSession() to return a MySession. Two solutions come to mind, but
neither seems optimal.

 

First, I could create a MyPanel for all my panels to extend, a MyPage
for all my pages to extend, etc. and have MyPanel and MyPage override
getSession(). However, that means a lot of duplicated code.

 

Second, I could update the Wicket source code, which would be quick and
easy, but then make upgrading Wicket difficult.

 

Is there a simple Java solution that allows me to change/add function
definitions into existing inheritance hierarchies?

Reply via email to