How to separate pages with dynamic content

Posted on 2004-10-28
Medium Priority
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.*,com.customer.care.constants.*" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>

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
  • 3
  • 2
LVL 13

Expert Comment

ID: 12439119
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

ID: 12439551
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

ID: 12441834
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

ID: 12448849
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

petmagdy earned 500 total points
ID: 12448923
Apache has a tag to scrab pages out side ur container u can download this from:


and read the Tag Library documentation at


Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.

601 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