• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DisplayTagLib not working (but it works fine with jstl core lib)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I'm a JSP beginner and would like to give out my "Project List"
in a html table. It's working when I use the normal jstl core
library. To make it look more pretty I tried to use the Display
Tag Library 1.1 - but without success.
I'm not using Struts but something like that. It's a framework
which is self written (not by me).
Maybee some JSP specialist could help me with the DisplayTagLib.

----------------------------------------------------------------
-- this here is working fine
-- (Reading my "Projekte" ArrayList out of my session formBean)
----------------------------------------------------------------
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<table border="0" cellpadding="4" width="100%" cellspacing="0">
<tr>
<th nowrap width="30%">Beschreibung</th>
<th nowrap width="12%">Beginn</th>
<th nowrap width="12%">Ende</th>
</tr>
<c:forEach var="projekt" items="${sessionScope.formBean.projekte}" varStatus="status">
<tr class="${status.index % 2 == 0 ? "dunkelgrau" : "hellgrau"}">
<td nowrap width="30%"><c ut value="${projekt.beschreibung}" /></td>
<td nowrap width="12%"><c ut value="${projekt.beginn}" /></td>
<td nowrap width="12%"><c ut value="${projekt.ende}" /></td>
</tr>
</c:forEach>
</table>


---------------------------------------------------------------
Now I'd like to do the same with the DisplayTagLib, but without success.
Again I would like to read my "Projekte" ArrayList out of my session formBean (like above).
First I installed the commons*.jar an the displaytag-1.1.jar into
my Tomact 5 deployment directory.


Then I tried:
----------------------------------------------------------------
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<display:table name="projekte" list="${sessionScope.formBean.projekte}"/>
</display>


==> Here I get: "Nothing found to display. "


Then I tried:
----------------------------------------------------------------
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<display:table name="${sessionScope.formBean.projekte}"/>
</display>


==> Here I get a beautiful Java Exception Stack which I'm not able to interpret.


Does anyone have an idea what I did do wrong
Thanks
Regards,
Reto
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Reto FL",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How hard would it be to "make it look more pretty" with some simple CSS while sticking to tags, like the JSTL, that are well-documented and are known to work?
 
Reto Kaufmann
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear Bibeault
Sorry for my bad name. I'v korrected it.
Do you know a forum or something where I could post my display tag library.
Regards
Reto
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instead of giving the List directly in the <display tag> using JSTL
assign it outside.
something like
Arraylist templist = ${bean.empList};
<display:table name="templist"/>

Also check out the displaytag-el version
[ May 22, 2006: Message edited by: Manikanta Sabarish ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic