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 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
Adding Parameter to href tag before uri

Categories

HOME
cloud
gremlin
path-finding
iot
syntax
xmpp
setup-deployment
filtering
malloc
ravendb
uber-api
directx
virtualization
nstableview
php-7.1
netflix
saxon
tostring
windows-7-x64
facebook-page
invantive-sql
shared-hosting
textfield
swingx
graphicsmagick
language-agnostic
microsoft-r
javacv
cas
facebook-access-token
windows-error-reporting
msys2
bpel
instant-messaging
preg-match-all
catch-all
nssegmentedcontrol
dosbox
serverside-rendering
starteam
c11
twitch
theano.scan
az-application-insights
reportbuilder
sqlite2
unobtrusive-validation
user-controls
awt
optix
estimote
businessworks
auto-update
angular-resource
qsslsocket
boost-multi-index
blogengine.net
sqlclient
memory-alignment
linode
google-feed-api
instant
rotativa
azure-virtual-network
database-optimization
multi-level
pcf
clang-static-analyzer
persist
ready-api
freelancer.com-api
tcpserver
teamcity-8.0
thredds
cakephp-3.1
ideamart
fluid-dynamics
cisco-ios
oberon
c++03
typekit
network-interface
document-classification
yorick
ember-charts
java.nio.file
sitemesh
inbox
eclipse-memory-analyzer
limejs
jelly
angularjs-controller
mhtml
mt
gdata-api
frameset
manchester-syntax
dbproviderfactories
qtkit
pendrive
punbb
heartbeat
xtype
google-friend-connect
.nettiers
web-architecture
.net-1.0
ajax-forms

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