• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Using JSTL example in K&B Book

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The example on page 436. I have set a an array in a servlet like shown below:



Then in the result.jsp I have done below:


But the ouput I get shown is:
<@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> Movie List

Im not being shown the list of movies as shown on p 436. Why?
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


But the ouput I get shown is:
<@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> Movie List



Hi Tontang Bei,

That is because you launched jsp page directly.
Launch the servlet that will set the request attribute and then dispatch
the later job of printing to the jsp page (output rendering).

Thanks,
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NO,I called the servlet first. Not the JSP.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are jstl.jar and standard.jar include in your library?
If yes, it seems to me, like there is no traversal is happening...
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes both the jars are included as directed on page 434. but still no luck.
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>



I think you are missing a % at the beginning

<%@ instead of <@

The missing % makes the text template text and it is rendered as is...
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THANKS Michael. It works now. This is probably the last time I'm going to use notepad again.!!(and code without my glasses )
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic