wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts Layout tag TLD error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Layout tag TLD error" Watch "Struts Layout tag TLD error" New topic
Author

Struts Layout tag TLD error

clyles
Greenhorn

Joined: Apr 30, 2002
Posts: 7
I've downloaded serveral struts-layout zip files from http://struts.application-servers.com/

* I place the struts-layout.tld within my WEB-INF directory and I place the struts-layout.jar file in the WEB-INF/lib directory.

* I modified the web.xml file to register the tld file.

* I created a sample jsp that I could create a simple collection object and then iterate thru the collection using the layout:collection tag.

* The jsp includes:
<%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %>
<%
List list = new ArrayList();
Program p = new Program();
p.setName("Item One");
p.setProgramId(new Integer(1));
list.add(p);
Program p2 = new Program();
p.setName("Item Two");
p2.setProgramId(new Integer(2));
list.add(p2);
Program p3 = new Program();
p3.setName("Item Three");
p3.setProgramId(new Integer(3));
list.add(p3);
Program p4 = new Program();
p4.setName("Item Four");
p4.setProgramId(new Integer(4));
list.add(p4);
pageContext.setAttribute("programList", list);

%>

<layout:row>
<layout:column>
<layout:collection name="programList" styleClass="row1" styleClass2="row2">
<layout:collectionItem title="Program Name" property="name"/>
<layout:collectionItem title="Program Id" property="programId"/>
</layout:collection>
</layout:column>
</layout:row>

But, all this work doesn't matter because I get an error stating:

Error in using tag library uri='/WEB-INF/struts-layout.tld' prefix='layout': The Tag class 'fr.improve.struts.taglib.layout.field.SuggestFieldTag' has no setter method corresponding to TLD declared attribute 'editType', (JSP 1.1 spec, 5.4.1)

I noticed in the Change report that someone corrected this problem. Then why am I still getting the error?

Anyone else having this problem?

Thanks.
clyles
Greenhorn

Joined: Apr 30, 2002
Posts: 7
I sent a message to someone within the Struts Layout group and they removed the attributes related to the tag in question. As a result, the problem with the tag is not longer an issue. The next problem is that the collectionItem tag needed to have four attributes removed: span, subtitle, subtitleArg0, and subtitleArg1. I removed those attributes and then got a 500 Error stating that there is a missing class: com/fgm/web/menu/MenuComponent.

As a result, I tried to create my own Struts-Layout.jar file hoping that I can locate the missing java file. As I'm compiling the java files, I see that I'm also missing a "MenuRepository" and "MenuAction" java file. Does anyone have any idea how I can locate those files?

Is everyone having these types of problems?

~Chris
[ March 10, 2005: Message edited by: chris lyles ]
D Crosscup
Greenhorn

Joined: Aug 13, 2008
Posts: 1
For those of you still having this problem... I didn't find many posts on the topic that helped me so I'm posting my solution here. My environment is weblogic 8 with struts-layout 1.3

In my case, I got the following error:

fr.improve.struts.taglib.layout.datagrid.DatagridTextTag' has no setter method corresponding to TLD declared attribute 'mode'

The problem was there is no attribute 'mode' in the DatagridTextTag class. I went into struts-layout.tld, found the section for "DatagridTextTag" and just deleted the small section referencing 'mode'. The solution of deleting non-existent attributes also works for previous versions of struts-layout. Version 1.2 TLD also includes one or more attributes inside a tag which that attribute doesn't exist. You only have to delete the attribute from the tag class the error message references.

Some app servers (such as tomcat and even weblogic 9) ignore the problem until you actually try to reference the attribute from your app.

Good luck!
[ August 13, 2008: Message edited by: D Crosscup ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
clyles,

Please check your private messages for a message regarding an important administrative matter. You can do so by clicking My Private Messages in the upper right corner of the page.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Layout tag TLD error
 
Similar Threads
Struts-layouts
how can I select a row in the table
How can I have a TAB inside my JSP
Navigation tree
getting the indexno of radio button from layout collections