This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Servlets and the fly likes static and dynamic includes HELP PLEASE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "static and dynamic includes HELP PLEASE" Watch "static and dynamic includes HELP PLEASE" New topic

static and dynamic includes HELP PLEASE

mary sarami

Joined: Feb 11, 2001
Posts: 25
I have the following working in Tomcat and JRun, no problems works great everytime.
Then I tested it on a OS/390 system, which is where it will reside, and I am having problems.
The following is the code I am using:
String agent = request.getRemoteAddr();
// unknown clients will be internet users
String incFile = "/text/head2.html";
if ( agent != null ) {
if ( agent.length() < 1 ) {
// return content for Internet Users
incFile = "/text/head2.html";
} else if ( agent.startsWith("198.103.") | | agent.startsWith("205.192.")) {
//return content for GNET browsers
incFile = "/text/head1.html";
<%-- dynamically include the file --%>
<jsp:include page="<%= incFile %>" flush="true"></jsp:include>
- on OS/390 the following works separately - but the above code does not work
<jsp:include page="/text/head1.html" flush="true"/>
<jsp:forward page="/text/head2.html"/>
I get the following message:
An error has occured while processing request:http://mvsc:8003/pbdev/m005-calculator-e.jsp
Message: Server caught unhandled exception from servlet [jsp]: Bad file argument to include
Any suggestions?
Is it possible that the file can't be found?
Is there a way to test for test?
I agree. Here's the link:
subject: static and dynamic includes HELP PLEASE
It's not a secret anymore!