• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference bw jsp: include page and @ include file

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a main jsp file that redirects, depending on the request, the appropriate jsp file. I was using at first:
<%@ include file="d_AllProjects.jsp"%>
But I started getting the "Illegal target of jump or branch" error once I had more than 17 includes (using condition to select the appropriate one).
so I switched the code to build the filename as a string depending on the request and then used:
<jsp:include page="<%=filename%>"/>
It's working but there's a small delay when the page is being pulled. I'm also not sure which one is best to use.
Any advice on how to clean this up?
Many thanks!
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because this syntax is a little akward, you might consider creating a custom tag for it?
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Zeina
In the <jsp:include ... > tag the page to be included is determined at runtime. As opposed to the <%@ include ...> tag which is done at compile time. So there will be more of a delay at runtime for the first one.
As far as the error you were getting when you have more than 17 includes I dont know why you'd be getting that. I would look at the 17th one you add and make sure the path info for it and all the spellings are correct.
 
Zeina Afif
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying.
I haven't used custom tags yet. (I haven't learned to yet...) I think after this demo this week, I'll try to rewrite some of my code and see what I could write in custom tags.
Dave, I know it sounds weird, but it's when I include any jsp file after the 17th condidion include, I get that error. It could be cause of some of the includes or references in the files...
I'm going to have to go back and 'clean up' and write some javabeans and custom tag. But to be honest, I don't know what should be in the javabean? Do you guys recommend any book or tutorial on the web on javabeans? and when best to use it? Everything I found on the web doesn't seem to apply to my project.
I am using MS SQL Server 7 for backend, and JRUN 3.1.
Thank you again!
Zeina
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic