Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

include file question!

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>
</jsp:include>
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.
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't you put the value into session, then the page can access
 
What's brown and sticky? ... a stick. Or a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic