GeeCON Prague 2014*
The moose likes JSP and the fly likes DisplayTagLib not working (but it works fine with jstl core lib) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "DisplayTagLib not working (but it works fine with jstl core lib)" Watch "DisplayTagLib not working (but it works fine with jstl core lib)" New topic
Author

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

Reto Kaufmann
Greenhorn

Joined: May 12, 2006
Posts: 2
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

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

Joined: May 12, 2006
Posts: 2
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
Manikanta Sabarish
Greenhorn

Joined: Jul 18, 2005
Posts: 14
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DisplayTagLib not working (but it works fine with jstl core lib)