aspose file tools*
The moose likes Servlets and the fly likes Dynamically add new pages to website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Dynamically add new pages to website" Watch "Dynamically add new pages to website" New topic
Author

Dynamically add new pages to website

Abhay Talreja
Greenhorn

Joined: Sep 04, 2011
Posts: 5
Hi All,

I wanted to implement a feature on my application, that when a user creates his own page on my site, i add his username to the url - identifying his own personal page.

The best example would be www.facebook.com/username/

We can select our own name and whenever we have the url with that name we directly land up on our page. May be there is a way to update it via xml? from the db?

I tried to google it but couldnt find a suggestion on how to approach and implement it on my site (JSP's)

Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61657
    
  67

It would be easy to map a servlet that accepts any random string, that you interpret as the username, as a path parameter.

Then it's just a matter of looking up the user-specific info in the DB and forwarding to a dynamic JSP that displays the user-specific data.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Abhay Talreja
Greenhorn

Joined: Sep 04, 2011
Posts: 5
Bear Bibeault wrote:It would be easy to map a servlet that accepts any random string, that you interpret as the username, as a path parameter.

Then it's just a matter of looking up the user-specific info in the DB and forwarding to a dynamic JSP that displays the user-specific data.


Thanks a lot, i'll try it and let you know the results. But, i think your solution makes sense to me.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42634
    
  65
You might want to read up on what a CMS is and does.


Ping & DNS - my free Android networking tools app
Abhay Talreja
Greenhorn

Joined: Sep 04, 2011
Posts: 5
Ulf Dittmer wrote:You might want to read up on what a CMS is and does.


Well, i am already working on it, i am planning to utlize spring (3.x) mvc framework, use hibernate. tomcat, include cms (yes i did read about it, and the read is on) from some other free source... (after a lot of study and my comfort-ability i have worked this out) you got any suggestion, to design a scale-able, maintainable website for personal use only ? - i could have gone for php but i have a java background and i know the power java has...

Also, on the topic, i asked a couple of friends and URL shortening was another option recommended.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42634
    
  65
URL shortening was another option recommended.

What do you mean by that? What's commonly understood by that phrase is a service like goo.gl or bitly.com; surely that's not what you intend to implement?
Abhay Talreja
Greenhorn

Joined: Sep 04, 2011
Posts: 5
Ulf Dittmer wrote:
URL shortening was another option recommended.

What do you mean by that? What's commonly understood by that phrase is a service like goo.gl or bitly.com; surely that's not what you intend to implement?


You are right, i also read the same. But, my friend was saying that what i am looking for can also be achieved by url shortening.

So, far i have not come across any example on url shortening that meets my requirements.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61657
    
  67

That's because, as Ulf pointed out, it has nothing at all to so with this issue.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Dynamically add new pages to website