my dog learned polymorphism*
The moose likes JSP and the fly likes Display JSP on custom URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Display JSP on custom URL" Watch "Display JSP on custom URL" New topic
Author

Display JSP on custom URL

Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 164

Hello,

I am developing (design stage) a web application. I would like to display each page in the app on its own custom URL. For example, Facebook allows users to have their own sub-url (facebook.com/users-custom-url). I would like my application to do the same but mine will be automated, my page URL's will be auto generated depending on the page content and this URL will be stored in a database.

Any suggestions that you have which would allow me to achieve this would be appreciated, for example, is this something the Spring framework offers?

Thanks,

G


OCPJP 6, OCMJD
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61222
    
  66

Use a Front Controller that gets called for all "custom" URLs (though not for images, scripts and other resources). This is easier if there is a specific prefix used for all "custom" pages.

The Front Controller can look up the association with the actual page for the "custom" suffix, and forward to that location. The URL in the browser will remain unchanged.

Could also be done with a filter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 164

Thank you Marshal! I will use that as a starting point for my research. If anybody else has suggestions / ideas, I'd love to hear them too.

G
 
 
subject: Display JSP on custom URL