Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-03-30
5
Medium Priority
?
434 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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