Solved

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

Posted on 2004-03-30
5
409 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSP Popup page 2 116
method inner class 6 82
bean mapper frameworks 5 60
jsp insert to database example 2 24
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
Adding Computers to AD groups through an SCCM Task Sequence
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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