How to separate pages with dynamic content

Posted on 2004-10-28
Last Modified: 2013-11-24
I have a question on how to accomplish the following:
I have a war file that has a jsp file called business.jsp.
This page has dynamic content that is filled in with jstl xml.

So i have the following page example:
<%@ page language="java" import="java.lang.*,java.util.*,*" %>

<%@ taglib prefix="c" uri="" %>
<%@ taglib prefix="x" uri="" %>

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

<x:parse var="xmlDoc">
      <%=(String)request.getSession().getAttribute( Constants.SESSION_ATTRIB_XML_DATA_FOR_APPLICATION ) %>

<x:parse var="xmlAppModeDoc">
      <%=(String)request.getSession().getAttribute( Constants.SESSION_ATTRIB_XML_DATA_FOR_APPLICATION_MODE ) %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <base href="<%=basePath%>">

<td bgcolor='#3DC8C4'>
                  <x:when select="$xmlDoc//QuestionLists[@accountId != '0']">
                        Customer Account #&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<x:out select="$xmlDoc//QuestionLists/@accountId" />
                  <x:when select="$xmlDoc//QuestionLists[@accountId = '0']">
                              <x:when select="$xmlDoc//QuestionLists[@anonymousId != '0']">
                                    Anonymous Account #&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<x:out select="$xmlDoc//QuestionLists/@anonymousId" />
                                    Cannot be tracked

This page has allot of content and from time to time the business
wants to change the content and some changes are so simple but b/c
we have had problems of deploying a new war file (after deploying
x number of times we can no longer deploy).  We have to stop and
start the servlet container.

What i was thinking of doing but not quite sure if this is something
that can be done is as follows:

Create either a web folder in our apache front end or a directory folder
and strip all the content in business.jsp page and put it into business.html
which will reside in either the web folder  on apache or a regular directory

When i say move everything i also mean all the jstl tags, etc.  I dont want
to create individual pages to go around the jstl tags b/c it may be harder
to manage.

So when i call the business.jsp through the browser, the business.jsp will
call the html page then build the dynamic content.

My question is can this be done and if so what is the best way of doing it?
How would you call business.html to business.jsp  from the apache folder
or the regular directory folder?

Thanks in advance
Question by:borg48
    LVL 13

    Expert Comment

    I not quite sure ur exact requirment but I think u need something like <jsp:include > to separate ur static portions into html on apache and include it from ur dynamic Jsp

    Author Comment

    Since all the jstl is on the html when i do an include will it then be processed properly:
    Will it follow these steps?
    1.  call business.jsp
    2.  jsp page does an include to business.html
    3.  jstl and dynamic content is then build
    4.  new html page is displayed.

    LVL 13

    Expert Comment

    please note that u can also include another JSP than contains jstl and other dynamic content, but if u will include html, it will only contain static content, usually web applications that has header and footer repeated in every jsp page, separate the header and footer into 2 htmls or jsps and included in all jsp pages

    Author Comment

    Can i include the jsp page from outside the servlet container?  As in my examples and when i load it  from the call of the business.jsp it will process all the jstl properly?
    LVL 13

    Accepted Solution

    Apache has a tag to scrab pages out side ur container u can download this from:

    and read the Tag Library documentation at

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    Suggested Solutions

    Title # Comments Views Activity
    Using Tomcat as raspberry pi java app server 13 55
    struts spring hibernate example 12 45
    Help on HTML 1 47
    haveThree challenge 22 81
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now