Invaluable JSP 2.0 / JSTL Cheatsheet

by Tim O'Brien

Related link: http://ndpsoftware.com/JSPXMLCheatSheet.html




Andrew Peterson of NDP Software has created a simple cheatsheet for JSP 2.0, JSP EL, and JSTL. I'm constantly "flipping" through the JSP 2.0 specs PDF trying to figure out what implicit objects are available in a JSP page and what the syntax is for fmt:formatDate, and Andrew has captured almost everything I needed in a single HTML page. del.icio.us.




Click here for the cheat sheet


6 Comments

gk5885
2006-02-21 18:30:13
this is PERFECT

This is the sort of thing that will save me a lot of time. There are far too many different syntaxes and although I can generally remember what most of them do once I see them, remembering JSP, XML Schema, XSL, and the 8 billion others that every framework seems to create is tough. Thanks for finding this.

bazzargh
2006-02-22 04:27:46
layout a bit messy in firefox 1.5
a bunch of the text overlays other text. The problem is this:


dd {
margin-top: -1.0em;
margin-left: 10em;
padding-bottom: .2em;
}


changing the margin-top to 0.0 em (eg with the web developer toolbar) makes it legible. I wonder what browser this was written for - alternating grey sections don't show up in IE.

raykrueger
2006-02-22 08:13:28
Very Nice
Thanks for pointing this out Tim. I'll be printing it up and stapling it to my cage, I mean cube. Yeah, the layout is a little tweaked (in all browsers actually) but it has good information and the layout doesn't make it illegible.
raykrueger
2006-02-22 08:22:09
Very Nice
Also, is there a way to check if a list contains an element from jstl? It would be great if you could do <c:if test="${something in myList}">... or something similar. This is something I've always wanted to be able to do and I never find a good way to do it.
tmo9d
2006-02-22 10:19:00
I'm pretty certain that there is not way to do this...
But, I could be wrong. I think the only way to really test this would be to loop through a collection in a forEach and then set a variable if a particular object matches. I could be wrong though.
tmo9d
2006-02-24 18:10:39
Very Nice
Ray,


No contains in JSTL, this is another reason to abandon JSP 2.0 in favor of FreeMarker: http://freemarker.sourceforge.net/docs/ref_builtins_sequence.html