• 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

jsp:include inside c:forEach

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to bother you with this one guys! Ive been experimenting a bit with JSTL and EL.
All I would like to do is, to print a table like this:
The movie list is:
  • Matrix
  • Titanic
  • --> Image of a Ship goes here which is fetched from some other jsp using <jsp:include>
  • Speed
  • Casino Royale[/b]
  • The image above is printed when the for loop encounters a variable called "Titanic".

    Here's the main display page: (display.jsp)[/b]
    The controller ContServlet(which sets an attribute movieList, which is holding a String array)[/b]



    .. and the head file(head.jsp) which is intended to be pasted just after "Titanic"


    The result Iam getting is something like this
    The movie list is:
  • ->> The Image from head.jsp
  • Matrix
  • Titanic
  • Speed
  • Casino Royale[/b]

  • Why does this happen? Why doesnt it print the head.jsp after "Titanic"?

    Many thanks!!

    [ September 03, 2007: Message edited by: Muni K Reddy ]
    [ September 03, 2007: Message edited by: Bear Bibeault ]
     
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I removed the bolding from your post -- it was giving me a headache and made the post hard to read. I'd advise against the overuse of bold in future posts.

    You might try specifying flush on the include, but why are you doing an include for just an image?

    And, I'd suggest exploring the use of tag files in place of includes in general.
     
    Muni K Reddy
    Ranch Hand
    Posts: 74
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Bear!
    Did you mean this?



    I used the flush now but the result is the same!

    I am sure I wont be using a logic like this for sure in future. I was just trying to find out how <jsp:include> reacts when inside a <c:forEach>. Nesting tags like this, I thought would make me understand each tag better!

    PS: Ive noted your tip about bold text. Thanks!
     
    It's exactly the same and completely different as this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic