File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to generate custom user URL ?" Watch "How to generate custom user URL ?" New topic
Author

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
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to generate custom user URL ?