File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSTL and Checkbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL and Checkbox" Watch "JSTL and Checkbox" New topic

JSTL and Checkbox

Rajakumar Iyyemperumal

Joined: Feb 18, 2008
Posts: 1
Rajakumar IyyemperumalCan any one tell me how to specify a checkbox using JSTL EL?
For example: In scriplet I have:
String a = "<input type = \"checkbox\" id=\"chk\" > Select";

<%=a%> will print the checkbox in jSP page
I need to have the same functionality using JSTL
Please help me
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

JSTL EL is not needed to draw the checkbox as you have it.
Your scriptlet was not needed either.
All you did was build up a string in Java and use a JSP expression to print it.

JSP is a templating language that was designed to prevent developers from having to build up strings in Java.

All you need to do is type it to the page:

[ February 18, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: JSTL and Checkbox
It's not a secret anymore!