• Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling html data.

 
Bala Gangadhar
Ranch Hand
Posts: 113
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working for a website using Struts2.0. The side has around 300 games and each game details are shown on a /game page. The format of the results are common accross the games so i am using simple game.jsp to show the game details. Apart from the results, now i had to display additional details of the game (around 300 hundred lines each) which includes bullet points and html tables. This html text is different for each game... The possible solutions i think for this are..

1. Have 300 jspfs with the details for each game and include in game.jsp based on the game
2. Store the details in html in DB for all the games, retrieve this html code based on game and show it on JSP.
3. Or define 300 jsp pages, and include the game.jsp in all the three hunred which is common and each jsp will have game specific details. Our struts.xml will have mapping based on the requested game (this may be the worst solution , i think of )

I dont think neither of the above are correct approach.. can you suggest me how can i handle this..
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bala Gangadhar wrote:
I dont think neither of the above are correct approach.. can you suggest me how can i handle this..


Each of your solutions has their own advantages and disadvantages:
1. probably the simplest to implement but a pain to maintain
2. Take some effort to create, especially if you don't already have a database in your project.  On the other hand, you aren't littering your file system with 100's of files.  Personally,  I don't like to use a db for data that does not require normalization (i.e. an order that requires a number of products as well as customer information). 
3. You don't want to duplicate the entire game.jsp.  When (not if) you want to make a change, it will be non-trivial.
You need to weigh the pros and cons of each.

You may be looking for a Content Management System.  It would not only help you organize your content but also help manage it.  That task could be passed on to someone who isn't necessarily a programmer, freeing you to tackle more interesting problems.
 
Bala Gangadhar
Ranch Hand
Posts: 113
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe Ess for the reply.

3. Or define 300 jsp pages, and include the game.jsp in all the three hunred which is common and each jsp will have game specific details. Our struts.xml will have mapping based on the requested game (this may be the worst solution , i think of )


I meant, i create game.jspf and will include in all the 300 JSP pages. So each examplegame.jsp will have its own content and include game.jspf (which has the common content). The only draw back is my struts.xml will have 300 mappings (Or if I can use some wild card with jsp page it will be single mapping ). Seems this option is manageable. 
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!