cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization hook for Web Dynpro applications

Former Member
0 Kudos

Dear all,

does anybody know about a hook to perform global Web Dynpro application initialization tasks?

I need to perform some application initialization once before any components/controllers are hit.

(So far as I experienced, wdDoInit() is invoked for each user (session) accessing the app.)

Of course a application termination hook would be great as well...

Thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Can you expand on exactly what you want to achieve, and why?

As far as I know, the Web Dynpro app is started for each user session, so there is no direct equivalent of application-scope variables, only session-scope.

However, depending on what you are trying to do, it may be possible to think of a workaround in order to achieve the same result.

Walter

Former Member
0 Kudos

Walter,

I'd like to find a place where I could perform some application wide initialization/shutdown tasks.

Examples would be to initialize some third party O/R mapping tool (like Hibernate e.g.) or to start up a IoC container like pico or spring.

For all kinds of this it is crucial that this happens only once...

Further, because resources like DataSource(s) need to be looked up, static initializers are no real option.

Any workaround to achieve this would be very welcome.

Former Member
0 Kudos

Hi Peter,

Have you considered creating and using a back-end EJB to provide you with the services you need? The EJB can then control the mapping tool's initialization and can take care of connections and anything else you would like it to do.

Use the Web Dynpro app to query the EJB for data.

Walter

Former Member
0 Kudos

Thanks Walter,

but my intention of initializing a light weight container and non-intrusive O/R mapping is to <b>avoid</b> usage of EJB at all.

It's a pity that the web dynpro framework seems to catch one in the EJB trap...

Best regards

Former Member
0 Kudos

Peter,

Every application has exactly one top-level component. Why not to use wdDoInit / wdDoExit of its component cotroller?

VS

Former Member
0 Kudos

Well, as I mentioned: wdDoInit() is invoked for each user accessing the application...

I was hoping that there would be an better opportunity.

Former Member
0 Kudos

Peter,

Then static block should be enough in component controller class. Code will be executed on class load, this occurs when first component instance is created.

Or static block paired with wdDoInit + static boolean variable that initialization was done.

Thoughts?

VS