Solved

Oracle and JSP <jsp:forward> with <jsp:include>

Posted on 2004-03-30
5
405 Views
Last Modified: 2008-03-06
<jsp:forward> plus the <jsp:include> are not working properly.

I have a jsp file named: "page1.jsp" and the user request to see this page.
in this jsp file after importing all the necessary classes, i include another page named "Header.jsp" like:
<jsp:include page="../Include/Header.jsp" flush="false" />

In this header file i connect to the database, and do some verification on whether the user can see page1.jsp file or not.
if he can see then no problem, if hedoesnt have the correct rightsto view the page then i forward the user to another page named "noAuthorization.jsp" like:
<jsp:forward page="../Administrator/noAuthorization.jsp" />

if i run this scenario using Tomcat then there is no problem, however if Oracle 9ias is used then what happens is that the noAuthorization.jsp file is displayed and then the page1.jsp file is also displayed.

In Tomcat what happens is that only noAuthorization.jsp file is displayed. This is what I want also, but somehow Oracle cant seem do do the trick.
Because of this I have some other errors too, which will be resolved after this is.

This is an urgent problem,
Thanks
0
Comment
Question by:glottis
  • 3
5 Comments
 
LVL 7

Accepted Solution

by:
searlas earned 500 total points
ID: 10713389
You are using the wrong sort of include for what you are trying to achieve.
It's most likely that you really want to use:
<%@ include file="../Include/Header.jsp" %>

This is quite interesting for the <jsp:include> tag:
flush="true"
You must include flush="true", as it is not a default value. You cannot use a value of false. Use the flush attribute exactly as it is given here.

From:
http://java.sun.com/products/jsp/tags/11/syntaxref11.fm11.html

0
 
LVL 2

Author Comment

by:glottis
ID: 10714441
<%@ include file="../Include/Header.jsp" %>

now why didnt i think of that ???

thanks for the help... ill award you the points in a couple of days, just in case this answer doesnt work out properly.

Thanks.
0
 
LVL 27

Expert Comment

by:rrz
ID: 10714889
I don't know anything about Oracle 9ias. Could you please tell us which Servlet API it uses ?  
The reason I ask is because the limitation of JSP 1.1(Servlet 2.2 API). The page that searlas has pointed to in his post is descibing JSP 1.1.  
You didn't tell us which version of Tomcat you are using. But I would assume that it uses JSP 1.2 +.  The limitation was removed in JSP 1.2 and the value of the flush attribute  can now be true or false.   rrz  
0
 
LVL 2

Author Comment

by:glottis
ID: 10723548
On 9ias JSP 1.2 (Servlet 2.3)
Tomcat 4.x
0
 
LVL 2

Author Comment

by:glottis
ID: 10858082
ooopss... sorry i forgot to award you the points.
your answer did help me.

thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
communication with a non technical owner 16 100
Need to view directory list in apache/tomcat 9 109
java cigar challenge 58 206
nested if has else if 13 92
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

23 Experts available now in Live!

Get 1:1 Help Now