Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-03-30
5
Medium Priority
?
430 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
[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
5 Comments
 
LVL 7

Accepted Solution

by:
searlas earned 2000 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 28

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Read on to get a few ideas on how to promote your next corporate event.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

664 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