0

Trying to access px_preferred_locale from session in a jsp

asked 2009-11-04 03:58:49 +0800

Luuzz gravatar image Luuzz
109 1

Hello,
I defined o Locale object and have set it in the session using Session.getCurrent().setAttribute(....). When i try to access the information in the session from a jsp file it doesn't return anything. Did zk really set it in the session or is there a special way to access zk session from a jsp ?
Thanks

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-11-04 22:11:28 +0800

samchuang gravatar image samchuang
4084 4

Hi ~~

In the .jsp page, you can use Sessions.getCurrent().setAttrbute(...), just the same as old times,

for example :
in login.jsp, I use session to save user's name
Sessions.getCurrent().setAttribute("user", name);

in main.jsp I could get user's name from session
Sessions.getCurrent().getAttribute("user");

I just use those in these days, it work~~hope could help you

link publish delete flag offensive edit

answered 2009-11-05 03:54:26 +0800

Luuzz gravatar image Luuzz
109 1

Thank you i'm gonna try this.

link publish delete flag offensive edit

answered 2009-11-05 03:57:41 +0800

Luuzz gravatar image Luuzz
109 1

I tried this but it returs NullPointerException ....

link publish delete flag offensive edit

answered 2009-11-08 17:18:47 +0800

samchuang gravatar image samchuang
4084 4

if you get null pointer in your case,

you could try to save object with native request or save in cookie

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: 2009-11-04 03:58:49 +0800

Seen: 417 times

Last updated: Nov 08 '09

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