Forums Register Login

Creating a Profile Page/Link

+Pie Number of slices to send: Send
Hi,
I am developing a webapplication, and as a part of it, i need to have individual links for the users profiles as shown below..
if the users has given the name as razzyy, then i want this user to have his profile at http:\\www.applicationname.com\razzyy

currently, i am thinking of creating a directory for each user with a common jsp file (welcome file) inside it.. this jsp will take 'razzy' out from the link http:\\www.applicationname.com\razzyy in order to identify whoes data is to be fetched and displayed..
am I right in this approach..?? or is there some other approach which will be followed in order to acheive this..? please suggest.


Thanks.
+Pie Number of slices to send: Send
That would be a very poor approach in my opinion. The info should be kept in a database, not on the file system, and a single JSP should be able to serve anyone's profile with dynamic data from the DB.
+Pie Number of slices to send: Send
I understand, but can you please tel me the right approach for this.
as the link here will be different for each user..
say for me i will have the link http:\\www.applicationname.com\razi
and yours could be like http:\\www.applicationname.com\bear

how can we redirect both these links to a single JSP..!??
+Pie Number of slices to send: Send
You can map a servlet to capture all the requests; for example with path /profile/*. That way, URLs such as /profile/bear and profile/fred would route to the servlet. Then in the servlet obtain the name from the path info.
+Pie Number of slices to send: Send
this solution creates a problem wen it comes to my requirement..
this will work for www.abc.com/profiles/bear
but not for www.abc.com/bear.. as, all the requests even the ones i dont want to will be redirected to a single servlet..

i have one more idea.. wat if i add the error handling in web.xml for 404 code.. all the pages which doesnt exist(even the profile links ex: www.abc.com/bear) will go to a single jsp and there i'l identify wheather the url should be taken as valid or actually it is invalid..
wil this ok..?! or any other better idea.. ??
I was her plaything! And so was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3125 times.
Similar Threads
How do EJBs fit in with Struts/JSP ?
How to create user web pages
Spring MVC-iBATIS problem with updating data from the form
Session or DB
Hiberanate loaded values not displayed in JSP page
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:37:14.