hello dudes,
kindly help me...

Example:

A new Facebook account is created...
once the user creates his profile then automatically custom URL is generated for him...

(ie)niranjan kumar facebook searched in google, here v can get by clicking the 2nd link as shown in the URL http://www.facebook.com/niranvk
...

now we can view niranjan kumar's profile...

same as now i create a profile in my own website http://localhost/projectname/profilename... now without logging in i want 2 look my public profile followed by the URL as http://localhost/projectname/anooprm.

how can i achieve this??/

Is this link generated dynamically???

Thanks in advance

The simplest way here would be to create a servlet ProfileServlet which handles the task of profile creation/viewing. Map this servlet to the path /profile/* . A GET request to this path would invoke the doGet() method of this servlet which would read the username from the URL, fetch the details for the given user, store it in the request scope and and forward to a relevant view i.e. the page which should be displayed to the user. A POST request to this URL would create a profile for the same user. For an in-depth overview of these things, look up on "servlet mapping", "fileter" and "servlet rewrite".

This task should be pretty easy if you are using a framework like Struts 2.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.