• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set distinct URL for every user?  RSS feed

 
Venki Ananth
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Is there any way to set a distinct URL for every users without making new jsp or passing a parameter(user ids) along with url.

Lets imagine this my project "http://hostname:portnumber/project". Any one can register here then i have to show the user's page like "http://hostname:portnumber/project/user1".

I tried in another way "http://hostname:portnumber/project/userpage.jsp?userid=1233" its working also. But client need distinct url what i mentioned above ("http://hostname:portnumber/project/user1").

Any idea?

Thanks in advance!
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to modify url like "http://hostname:portnumber/project/user/user1" , where 'user1' I'm considering as user's registered name.
 
Venki Ananth
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar!

Could you please explain me little clear! What is "user"? and how can i get "user1" in my page to identify a user so i can show his/her data alone!

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here, "user/user1" is part of url which maps to the servlet for user action. In DD, you define something like this,

[Please dig up little about how to use the wild card '*'.]

In UserServlet, you can extract the part of request url, which gives you 'user1', and you can do what ever you want to do with that user. This idea is implemented here on JR, like 'My Posts' [See URL].
 
Venki Ananth
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool! Got clear idea! Thanks Sagar.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My pleasure
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!