0

How to get an application object in java ?

asked 2008-12-29 09:25:53 +0800

evpole gravatar image evpole
481 2

I want to set some variables in application.
in zscript, we can do like this:

------------
application.setAttribute("user",myuserbean);
------------

but zscript is not encouraged because it will slow the project a bit.

so I want to setAttribute in java files.

I've tryed: new WebApp().setAttribute();
but error said:"can't realize WebApp".it seems to be a static class.
so I tryed: WebApp().setAttribute();
error said:"setAttribute() is not a static method."

the How could I get the application Object?
thanks for supply any information.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2008-12-29 13:41:55 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Please try:

Sessions.getCurrent().getWebApp()

Cheers, Maik

link publish delete flag offensive edit

answered 2008-12-30 01:56:26 +0800

evpole gravatar image evpole
481 2

haha , It works perfectly!

Thank you very much,mjablonski!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-12-29 09:25:53 +0800

Seen: 248 times

Last updated: Dec 30 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More