Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to generate custom user URL ?  RSS feed

 
Hatem Alimam
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody ...

I wonder how can I generate a custom user URL in java ?

I mean when a user registers in my website I want to generate a custom profile page url example : http//mydomain/username >>>>this url takes the user to his profile page

regards ))
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's pretty easy with URL mapping if your URL can have a few more parts, For example:

http://www.something.com/contextpath/profile/username

The contextpath is necessary for identifying the application (but can be omitted if the app is the root application), and profile can be a servlet mapping that invokes a servlet that will look up the user's profile and forward to a JSp for displaying it.

Within the servlet, the username part of the URL can be retrieved using the path info methods on the request.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!