This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes include file question! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "include file question!" Watch "include file question!" New topic

include file question!


Joined: May 28, 2001
Posts: 5
Hi there,
I am having a problem with including files. I used
<%@ include file="filename" %>
which works great, but the problem is that this include is a static include, which means that any changes to the included files wouldn't be reflected on the actual jsp file util that jsp file changes. I also used this include:
<jsp:include page="/../filename" flush="true">
<jsp aram name="parametername" value="1"/>
which works great, any changes made to the included file are reflected on the jsp page.
But here is my problem: The first include (since it is static) lets me access any variables on the included file from the jsp page. For example on my jsp page I can do this: out.write(var1); Where var1 is a variable in the included file. The second include doesn't allow me to do that. So is there any way to be able to access variables on the inluded file directly from my jsp page? ( I mean on the second include).
If anyone can help I would be greatful and thanks in advance.
Cynthia Yao
Ranch Hand

Joined: Nov 06, 2000
Posts: 92
why don't you put the value into session, then the page can access
Don't get me started about those stupid light bulbs.
subject: include file question!
Similar Threads
Can JSPs embedded in other jsp ?
@include v/s jsp:include
Include Directive vs Include Action
confused about the limitation of the jsp:include tag
doubts realted to include directive