0

URIInterceptor help needed

asked 2008-06-12 20:43:22 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5027459

By: danielcj

Hi,

I'm trying to use URIInterceptor to create the authentication engine of my application. To do that, I've setted it up in zk.xml and created my class which implements URIInterceptor. It works fine, as I've done some tests.

But I don't know how to recover some data from the user session, as the user id. My login page, to which all users have access, enables user to put username and password; when it tries to authenticate, if suceed, I store users id in the session.

Now I need to recover the user id in order to check if he/she has permission to an specific URL.

Thanks in advance,

Daniel

PS: congratulations ZK for the great job.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2008-06-17 04:14:52 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5037135

By: jebberwocky

Someone wrote an article on "ZK Session Management." But, it is in Chinese.
Check this google translated verison
http://translate.google.com/translate?u=http%3A%2F%2Fwww.javaworld.com.tw%2Fjute
%2Fpost%2Fview%3Fbid%3D49%26id%3D226214%26sty%3D3&hl=en&ie=UTF8&sl=zh-CN&tl=en

link publish delete flag offensive edit

answered 2008-06-18 01:20:03 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5039101

By: henrichen

1. ZK wrap the HttpRequest with Execution class.
2. Executions.getCurrent() get the current Execution.
3. Execution.getNativeRequest() get the HttpServletRequest.
4. HttpServletRequest.getSession() get you the HttpSession.
5. ...

Executions.getCurrent().getNativeRequest().getSession();

http://www.zkoss.org/javadoc/3.0.5/zk/org/zkoss/zk/ui/Execution.html#getNativeRe
quest()

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-06-12 20:43:22 +0800

Seen: 164 times

Last updated: Jun 18 '08

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