jsp-tags


creating a custom JSP tag


I'm trying to create a custom JSP tag that would take an array object and display the elements of the tag in an HTML table. Does anyone have suggestions on how to do this?
As Phill mentioned, the Display Tag taglib is very good for this, but it's actually really easy to do using JSTL:
<%# taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
.
.
.
<table summary="">
<thead>
<tr>
<th>Property 1</th>
<th>Property 2</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${someArrayObject}">
<tr>
<td><c:out value="${item.property1}" /></td>
<td><c:out value="${item.property2}" /></td>
</tr>
</c:forEach>
</tbody>
</table>
Depending on your needs, a custom taglib may be overkill.
Do you mean something like displayTag? That can form tables out of lists of objects.

Related Links

how can i retrive parameters from EncodeURL using jsp?
onclick tag giving error in h:commandLink
Displaytag - How to pass hidden value in url?
Embedding Tag Files in a JAR
Errors when the compiler is trying to build a custom JSP tag based on an Java Bean
Creating nested custom tag using jsp2 tag files
Unable to access session on JSP
Dealing with <html:options>
No tag “tableFacade” defined in tag library imported with prefix “jmesa”
how to refer values of one jsp file to other jsp
incorrect username and passwords
creating the welcome page
How to use list object in <c:forEach tag?
How to call a Servlet when I click on a Hyperlink
EL Messages on JSP page
showmodaldialog function in ie8

Categories

HOME
sendgrid
debugging
gremlin
relay
bpmn
bookshelf.js
setup-deployment
jsrender
alpha
flyway4
esper
fancybox-3
kentor-authservices
google-cloud-ml
opentracing
oracle-coherence
crystal-reports-2008
karma-jasmine
facebook-instant-articles
telerik-reporting
qhull
wpfdatagrid
msys2
newline
bosh
functor
airconsole
ioio
picasso
android-ble
web-mining
neuroscience
withings
abstract-class
objectlistview
theano.scan
leading-zero
pdf-reactor
gpx
reactive-cocoa-5
sencha-touch-2.3
google-datalayer
flickr-api
multipeer-connectivity
pnotify
aurelia-validation
elgg
mako
bind9
webdriverjs
mediaelement
pintos
probability-density
bonobo
elements
py2app
multiple-regression
lttng
skype4py
hill-climbing
make-install
sdf
php-internals
associative-array
separator
ora-00900
cannon.js
mutation-observers
simple-framework
quicklisp
wyam
vstest.console.exe
truevault
npapi
block-device
google-style-guide
mesa
heisenbug
jubula
phpthumb
html5-notifications
gridfs
cos
django-nonrel
specification-pattern
dsn
hosts-file
ticoredatasync
chrono
enter
spring-portlet-mvc
hirefire
coercion
invite
file-comparison
oncheckedchanged
site.master
mozilla-prism
meego
web-architecture
javap
premature-optimization
putchar
w3wp
django-notification
signal-handling
windows-live-messenger

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html