Storing JSP content in a Database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chris_Melville
Posted On:   Monday, May 20, 2002 05:35 AM

The current content management system we are using stores its content in an oracle database which is retrieved via a custom api and included in a JSP page. However, often the html content alone is not enough, and we would like to store jsp custom tags in the database as well, for parsing by the jsp page once retrieved from the database. So, basically, the question is how to get some text (which has originally come from the database) parsed as if it were jsp content, from the jsp page. I don't think it's possible but any confirmation of that would be as welcome as a solution. The current workaround at the moment is to put tags into the html con   More>>

The current content management system we are using stores its content in an oracle database which is retrieved via a custom api and included in a JSP page.



However, often the html content alone is not enough, and we would like to store jsp custom tags in the database as well, for parsing by the jsp page once retrieved from the database.



So, basically, the question is how to get some text (which has originally come from the database) parsed as if it were jsp content, from the jsp page.



I don't think it's possible but any confirmation of that would be as welcome as a solution.



The current workaround at the moment is to put tags into the html content (such as [username]) which then get replaced by a struts action before being used in the page itself.

   <<Less

Re: Storing JSP content in a Database

Posted By:   Steven_Martin  
Posted On:   Monday, May 20, 2002 06:23 AM

Ouch, sounds painful. Here's what I would do in that situation. Store in the database the action key to take. Then on the jsp page, that action key triggers a specfiic jsp tag. You could even put that in a JSP include and pass the action tag to the JSP.



The scenario you are describing violates the MVC concept in that the View is completely dependent on the model and you will decrase significantly the maintainability of the app.



Okay, what are you talking about? :) Persistant data should typically involve data that is revelant for many years to come. Will this application still be using custom JSP tags in years to come?
About | Sitemap | Contact