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 we display value in java server page set in dto
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

Categories

HOME
openmp
include
rsync
cakephp-2.5
jpeg
indesign
node-notifier
dacpac
wheelnav.js
usergrid
flask-wtforms
openrefine
textfield
xlsxwriter
cloudhub
trading
opennlp
wpfdatagrid
internet-explorer-9
srcset
unboundid
bluestacks
google-rich-snippets
uisplitview
noraui
typed.js
kendo-ui-grid
catch-all
ghost4j
wallpaper
bytecode-manipulation
automake
xenforo
opshub
firebase-admin
modelmapper
.net-4.6.2
user-accounts
strptime
pubmed
errordocument
rails-routing
jquery-validate
drupal-6
r-forge
knpmenubundle
mcafee
django-scheduler
spring-android
ado.net-entity-data-model
php-internals
goose
xna-4.0
execute
marching-cubes
ruby-2.2
django-unittest
processmodel
p2
lustre
directoryservices
block-device
c3
android-imagebutton
preferences
ceil
contenttype
jubula
expected-exception
htmlcleaner
sharp-repository
flashvars
robotics-studio
angularjs-controller
pvrtc
dmoz
osql
dotnethighcharts
amazon-appstore
pydot
genshi
mirah
brewmp
virtual-functions
procedural-music
signal-handling
document-conversion

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