aspose file tools*
The moose likes JSP and the fly likes jsp:include  inside  c:forEach Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp:include  inside  c:forEach" Watch "jsp:include  inside  c:forEach" New topic
Author

jsp:include inside c:forEach

Muni K Reddy
Ranch Hand

Joined: Aug 23, 2007
Posts: 74
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 ]
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61768
        
      67

    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.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Muni K Reddy
    Ranch Hand

    Joined: Aug 23, 2007
    Posts: 74
    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!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: jsp:include inside c:forEach