This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

jsp:include not working  RSS feed

 
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple index.jsp page that looks like this:

And my main_header.jsp looks like this:

When I go to index.jsp I get no erros, and I get a blank screen. When I view source, I see the HTML from index.jsp, but nothing from main_header.jsp. Am I doing something wrong?
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am not wrong... But not very sure... U specify the flush attribute to be "true", which means that the output of the current page is sent to the user before the output of the included page is done... U can see the details about the attributes of jsp:include in the following link to JSP syntax reference...
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I changed it to false, but still get the same results. Thanks anyway.
 
Author and ninkuma
Marshal
Posts: 66784
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg, is the url you are providing to the include context-relative?
bear
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just getting ready to post before you responded Bear. I changed the URL to be relative to what page I am on..
So what I had became:
<jsp:include page="includes/main_header.jsp" flush="true"/>
And it worked.
So is there any way I can make the URL absolute to my Context? So I am stuck doing things like ../../includes/main_header.jsp in other pages? I would rather just do /holocron_struts/includes/main_header.jsp on every page I need it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66784
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is holocron_struts your context path or a folder within the context?
If it's your context path, leave it off as a context-relative url doesn't include the path name itself.
bear
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66784
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In other words, try

if holocron_struts is your context.
bear
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, holocron_struts is my context path. I'll give it a shot. Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked out great Bear! Thanks a bunch!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!