This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes Designing Webapp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Designing Webapp" Watch "Designing Webapp" New topic

Designing Webapp

Servin Park

Joined: May 10, 2002
Posts: 26
Hello all,
I bought a package from a Web Hosting Company and am building a webapp that can serve as a community news site. what I would like to accomplish is this:
1. Editors can add, modify their columns any time they want.
2. Readers can read the most up-to-date information all the time.
I thought about two solutions:
1. Each time an editor add a column (essay, news, information, events, etc.), write a html file in a designated folder. When a user accesses particular page, just include the html in the jsp. I just need to figure out a way to sort all the html out so that they get included correctly.
2. Save all the columns in database. When a user accesses particular page, get the content from a table in the database.
The first solution will work fine for me, but I don't like too much File I/O happening in the server. The second solution will work fine also, but concerned about database usage. It appears to me that every user click will require database connection, query, etc...
What do you think? If you have better solution or comment about any of my solutions, please drop me a note.
Many thanks in advance for your help.
chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
it largely depends on how much time yuo are willing to spend and how much value there is in this. From the possible solution you offer, you would benefit greatly from the experience that this type of development work would offer and I think you would be happy with the result. I've implemented similar solutions for very low cost web sites
a connection or two per hit is not actually a problem so dont worry about that side of things. File IO can be more problematic but you havent really indicated how many users this involves and how often the content would change.
a third option might be to hold the data in the database but to generate static html pages from the resultant content which i have seen used to great effect to manage the content while limiting the load on the server

chanoch<p><a href="" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
It is sorta covered in the JavaRanch Style Guide.
subject: Designing Webapp