Hello everyone
I'm studying for the SCWCD using "Head First
Servlets and JSP" (2nd edition)
On page 521 I found an example of a simple tag with an attribute, and I have managed to make it work as described.
The
JSP tag Invocation does not state how the movieCollection came about, so I made a scriptlet (shame on me!) doing the job:
(I made a Movie javaBean containing a title
String and a genre String)
But - what's nagging me is, that since scriptlets are considered "bad" (for all sorts of sensible reasons), I wanted to do what the scriptlet does, but in a scriptless way.
I have tried using <c:set> combined with EL etc. but, until now, to no avail.
I couldn't even manage to create the List with the scriptlet and populate it using <c:set>
I'm sure that some of you consider this a trivial matter, so I'm eager to learn from you.
p.s. I'm aware that I could hit a Servlet and let it create and populate the List and set it as an attribute on the request and then forward the request to the JSP, but I think that's kind of missing the point.
p.p.s. The movie genres are not to be taken seriously :-)
Cheers everyone