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

Difference between jsp include action tag and jsp include directive
How to iterate through a list of list in jsp
JSP Custom Tag File and Dynamic attributes
Fetch drop down box multi selector
jsp code to upload jgp files and save in mysql db
when I run my jsp pgogram I got this exception error type Exception report
jstl formatNumber in input leads to NumberFormatException
Youtube onYouTubePlayerReady() function not firing
username and password cannot be resolved or is not a field
How page directive “extend” in jsp works?
Simple property not found?
Reusing JSP custom tags inside html
JSP Quiz process is not giving me the correct percentage scored
Refer the id variable of logic - iterate using jstl-el
Invalid tagdir attribute while web-fragment is used
JSP foreach tag for two variables

Categories

HOME
vim
oracle11g
push-notification
mfc
google-play
tinymce
sd-card
alfresco
android-4.4-kitkat
razor
v8
enterprise-library-5
uber-api
portia
virtualization
gitpitch
windows-azure-storage
vb.net-2010
remote-access
orchardcms
visual-studio-2005
seaborn
apache-metamodel
normalizr
samoa
lldb
excel-2007
google-search-api
dynamic-featured-image
facebook-access-token
traffic
libssl
tasklet
key-value-observing
siesta-swift
mozilla
rotational-matrices
normal-distribution
libvpx
unobtrusive-validation
broadcastreceiver
android-tabhost
qcombobox
convertapi
angular-resource
dandelion
veracode
r-forge
ifs
spring-mongodb
redundancy
vtigercrm
or-tools
visual-c++-2008
wdf
multi-level
py2app
ctest
xml-attribute
firebaseui
react-native-listview
superstack
metaclass
libressl
browser-bugs
pretty-print
umbraco6
knuth
asp.net-dynamic-data
fpml
rdtsc
heisenbug
mysql-error-1062
ember-charts
centos5
mysqltuner
xsockets.net
dbconnection
html4
eventlistener
jquery-knob
isnullorempty
asyncfileupload
hgsubversion
transactionscope
xmemcached
html-input
site.master
routedevent
nhibernate.search
fixed-width
xetex
zend-decorators

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
Mobile App
Mobile App
Mobile App