• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:include tag

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I am trying to include a <jsp:include> tag in my dynamic jsp, but it does not seem to work. In place of where jsp include should be I just see blank space.

thanks,
Alex
[ December 18, 2003: Message edited by: Alex Kravets ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a number of things I don't understand about your code:
1) Why the braces around the page URL?
2) Why are you using out.println to emit HTML rather than directly inlining it?
To perform the include, I'd build up the complete URL in a String (or StringBuffer as appropriate) and reference it as a unit. Something along the lines of:

just to keep things simple and easier to diagnose.
bear
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Bear,
1.I used braces because I saw it in reference page for jsp include
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html , they use it for relative URL, so I've changed it accordingly.
2.I use out.println because I insert html tags along with a lot of logic in my jsp and did not want to bother with opening/closing <%/%>.
Your example worked. Thanks a lot!
[ December 18, 2003: Message edited by: Alex Kravets ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not to lecture, but
2.I use out.println because I insert html tags along with a lot of logic in my jsp and did not want to bother with opening/closing <%/%>.

think about that one for a bit.
bear
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!