Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to separate pages with dynamic content

Posted on 2004-10-28
5
Medium Priority
?
187 Views
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>

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

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

<td bgcolor='#3DC8C4'>
            <x:choose>
                  <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>
                  <x:when select="$xmlDoc//QuestionLists[@accountId = '0']">
                        <x:choose>
                              <x:when select="$xmlDoc//QuestionLists[@anonymousId != '0']">
                                    Anonymous Account #&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<x:out select="$xmlDoc//QuestionLists/@anonymousId" />
                              </x:when>
                              <x:otherwise>
                                    Cannot be tracked
                              </x:otherwise>
                        </x:choose>
                  </x:when>
            </x:choose>
..
..
</html>


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
folder.

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
0
Comment
Question by:borg48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:petmagdy
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
0
 

Author Comment

by:borg48
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.

0
 
LVL 13

Expert Comment

by:petmagdy
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
0
 

Author Comment

by:borg48
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?
0
 
LVL 13

Accepted Solution

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

http://jakarta.apache.org/taglibs/doc/scrape-doc/intro.html

and read the Tag Library documentation at

http://jakarta.apache.org/taglibs/doc/scrape-doc/index.html
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
A solution for Fortify Path Manipulation.
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.

636 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