Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifiā€¦
A procedure for exporting installed hotfix details of remote computers using powershell
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

11 Experts available now in Live!

Get 1:1 Help Now