Question

I'm creating a J2EE web application in which I'm giving my users an ability to create a page (Yeah almost like Facebook ;) ). These pages will be created dynamically i.e. user will be asked some details like page name, description etc, moreover the user will be asked an unique URL Eg: www.mywebsite.com/user_unique_url.jsp for the page and after submitting all the details the page will be created. What I'm looking for is that a mechanism through which when the user has submitted all the details a page would be created and with the URL as given by the user. I'm open to other suggestions which helps me as how to create such page. Thanks in advance.

Was it helpful?

Solution

Creating a new JSP file for every page is not a good idea. You can just create one JSP file (template), and for every user, you can put the right information in the right place.

For example www.yourwebsite.com/userpageID is the URL of the page. Get all the page information with a simple SELECT query (ex : SELECT * FROM pages WHERE id = userpageID ). And in your JSP file, you put information selected by the query.

OTHER TIPS

I'm not a java developer but you're looking for routes.

There will be probably a configuration file where you can redirect every request to another address.

For example; Requests on http://local.hots/what_you_want

are redirected to http://local.hots/page.jsp?page=what_you_want

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top