aspose file tools
The moose likes Servlets and the fly likes How to generate custom user URL ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to generate custom user URL ?" Watch "How to generate custom user URL ?" New topic

How to generate custom user URL ?

Hatem Alimam
Ranch Hand

Joined: Dec 14, 2008
Posts: 30
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 ))

SCJP 5.0, SCWCD 1.4, SCBCD 3.0 with 100 score
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62312

It's pretty easy with URL mapping if your URL can have a few more parts, For example:

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Have you tried LearnNowOnline?
subject: How to generate custom user URL ?