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

Display JSP on custom URL

Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 168


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 ( 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?



Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

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] [About Bear] [Books by Bear]
Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 168

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.

I agree. Here's the link:
subject: Display JSP on custom URL
It's not a secret anymore!