cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically changing JSP's like HTML

nitinaggarwalin
Champ in-the-making
Champ in-the-making
Hi

We have a Struts based web Application and we are using Alfresco as CMS.

The problem we are facing is to dynamically edit jsp pages(we have about 60-70 jsps) in our application.

Can anyone tell me how we can have the changes being reflected on the run if any of the  content managers / admin changes the JSP from Alfresco.


One approach we tried was:
1 Manually create a XSD and a XSLT corresponding to each JSP.
2. Using these XSD and XSLT we had alfresco generate the corresponding XML for us.
3 Then try to create an HTML from that xml using alfresco.
4. Include this html in the JSP code and removing all the previous code from the JSP.

But the drawback to this approach is a lot of re work and tediousness.

Can any one suggest another better efficient alternative.      

Regards
Nitin Aggarwal
nitin.aggarwal@birlasoft.com
3 REPLIES 3

kvc
Champ in-the-making
Champ in-the-making
Nitin:


Why not have your template generate the entire JSP from your template?  Then, users can simply click edit on the JSP, access the form data, modify, and then preview the updated JSP directly.  This seems an easier approach of generating an HTML and remembering with JSP to preview later.


Kevin

nitinaggarwalin
Champ in-the-making
Champ in-the-making
Is it possible to generate a JSP using webforms ? If so how ?

tommorris
Champ in-the-making
Champ in-the-making
A simple approach I would attempt, would be to:

1. Use the freemarker option rather than the XSL option.
2. Rename your existing *.jsp pages to *.ftl.
3. Edit these ftl templates to insert the xml form data in as required.
4. Make sure the output path correctly ends with '.jsp'.
5. Make sure the mime-type remains as 'HTML'.

You can follow existing freemarker samples and don't forget to write the correct freemarker namespace declaration at the top.