wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes Storing code in the database (yay! wooo!) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Storing code in the database (yay! wooo!)" Watch "Storing code in the database (yay! wooo!)" New topic
Author

Storing code in the database (yay! wooo!)

Caden Whitaker
Greenhorn

Joined: Jan 15, 2009
Posts: 24


We have a series of landing pages accessable to our clients. Our clients send emails out and the receivers can click on a link that sends them to a landing page.

This landing page could do multiple things, for example, our most entertaining landing pages do the following:

1) Hit a database to display information

2) Show a form

3) Open a PDF

4) Prompt the receiver to download an xls spreadsheet

Not only that our clients want the ability to design their own landing pages with their own logic. This may involve pages that hit the client's webservices or other 3rd party operations.

So I could do it this way:

1) Create a table called landing_page with columns like id/location, the location would point to a specific jsp, so data like this:


Which could point to a folder on our webserver, like this:


And when the email goes out, we would include the specific jsp in a link.

However, that means each new client request must require a code built on our end (or us giving hundreds of clients access to the web root). This is becoming painful.

I could store the jsp in the database, this would give me the power to allow clients to create their own "code", it could be forced throug a QA session (like they must present their code to our QA environment, and then when we approve it, it moves to production). This seems to be a well recived idea because our clients are asking for the ability to turn this over to their developers.

However, this means I am building yet another specific framework that some poor sap is going to complain about 3 years from now.

What does that leave me? Could I do something with groovy, groovy server pages, grails, is there something out there that is supportive of this idea/concept?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

FreeMarker, Velocity, any template language. As long as what's available on the page is defined by you, this approach works just fine.

You will suffer mightily regardless: pain and anguish are inevitable.

If they need access to arbitrary data and functionality you'd be better off using a wiki.
 
 
subject: Storing code in the database (yay! wooo!)
 
Similar Threads
Properties File Versus JDBC Lookup
tomcat 6, Xampp - jsp pages just display the source code and do not execute
Uploading, saving and displaying images using servlets
Problem with referencing session information from 2 contexts, one a subfolder of another
How to store the PDF file in the server side?