Generating unique URL for Unique users in web site
I am developing a web application where users are going to register on it, after that it displays a dashboard for each user.A Dashboard will be unique to the every user,It should be similar to facebook(i.e if user registers to the FB the unique URL address is generated like www.facebook.com/'name-of-theuser'). I want to implement same functionality on my web application ,what is the logic behind this?How do i implement this? Kindly help me. Technology using for 开发者_Go百科this is: Front-end : HTML and scripts Server-Side:Servlets and JSP's
I will have a servlet whose url pattern is /users/*
Then for every user I will have urls /users/usera /users/userb /users/userc etc
In the servlet I will check the getContextPath of the HttpServletRequest and serve a unique page based on the contextPath.
This should help you out:
http://www.workingwith.me.uk/articles/scripting/mod_rewrite
And here is a 'Java version' (for use as a ServletFilter):
http://www.tuckey.org/urlrewrite/
精彩评论