Advertisement

01.24.2007 at 08:20AM PST, ID: 22134944
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

display tag - problems using table decorator to create a dynamic link
Tags: displaytag
Hi,
 
I'm having some problems implementing the examples on the display tag website for creating dynamic links using a table decorator.  
 
I have the following setup:
 
I have a jsp page that displays my table (data is pulled from a database and put into a RowSetDynaClass):
 
<%
RowSetDynaClass new_ncs = ActionViewTables.newNCTableSC(sdid_string);
%>  
<% request.setAttribute("new_ncs_sc", new_ncs); %>
<display:table name="requestScope.new_ncs_sc.rows" id="row" decorator="teska.displaytag.Wrapper">
<display:column property="sfdid" title="ID" sortable="true"/>
<display:column property="level" title="Level" sortable="true"/>
<display:column property="form_name" title="Form Name" sortable="true"/>
<display:column property="last_name" title="System Coordinator" sortable="true"/>
<display:column property="date_submitted" title="Date Submitted" sortable="true" decorator="teska.displaytag.LongDateWrapper"/>  
<display:column property="scncviewlink" title="Take Action" />  
</display:table>
 
I have created my own wrapper class as follows:
 
package teska.displaytag;
 
/**
* Licensed under the Artistic License; you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://displaytag.sourceforge.net/license.html
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*Originally from: package org.displaytag.sample;
*
*
*/
 
 
import java.text.DecimalFormat;
import java.util.*;
 
import org.apache.commons.lang.time.FastDateFormat;
import org.displaytag.decorator.TableDecorator;
 
 
/**
* This class is a decorator of the TestObjects that we keep in our List. This class provides a number of methods for
* formatting data, creating dynamic links, and exercising some aspects of the display:table API functionality.
* @author epesh
* @author Fabrizio Giustina
* @version $Revision: 1.12 $ ($Author: fgiust $)
* modified by C Teska Race
*
*/
 
public class Wrapper extends TableDecorator{
 
/**
* FastDateFormat used to format dates in getDate().
*/
private FastDateFormat dateFormat;
 
/**
* DecimalFormat used to format money in getMoney().
*/
private DecimalFormat moneyFormat;
 
 
/**
* Creates a new Wrapper decorator who's job is to reformat some of the data located in our TestObject's.
*/
 
public Wrapper(){
super();
 
this.dateFormat = FastDateFormat.getInstance("MM/dd/yy"); //$NON-NLS-1$
this.moneyFormat = new DecimalFormat("$ #,###,###.00"); //$NON-NLS-1$
}
 
 
public String getScncviewlink(){
ListObject currRowObject = (ListObject)getCurrentRowObject();
String sfdid = (currRowObject.getSfdid());
return "\<a href=\"/displayView.jsp?sfdid=" + sfdid + "\"\>View\</a>";
}
 
 
/**
* Test method which always returns a null value.
* @return <code>null</code>
*/
public String getNullValue(){
return null;
}
 
 
/**
* Returns the date as a String in MM/dd/yy format.
* @return formatted date
*/
/*
public String getDate(){
return this.dateFormat.format(this.getCurrentRowObject().getDate());
}
 
*/
 
/**
* Returns the money as a String in $ #,###,###.00 format.
* @return String
*/
/*
public String getMoney(){
return this.moneyFormat.format(this.getCurrentRowObject().getMoney());
}
*/
 
}//close class
 
 
When I run this code I get the following error message:
 
500 Servlet Exception
 
Note: sun.tools.javac.Main has been deprecated.
/home/teska/public_html/sandbox1/WEB-INF/classes/teska/displaytag/Wrapper.java:64:
Class teska.displaytag.ListObject not found.
ListObject currRowObject = (ListObject)getCurrentRowObject();
^
/home/teska/public_html/sandbox1/WEB-INF/classes/teska/displaytag/Wrapper.java:64:
Class teska.displaytag.ListObject not found.
ListObject currRowObject = (ListObject)getCurrentRowObject();
^
2 errors, 1 warning
 
 
Resin 2.1.16 (built Tue Feb 15 11:12:27 PST 2005)
 
 
My questions are:
 
1: Where do I get the ListObject class and where do I put it to have ot work - does it need additional classes to work?
 
2. I'm not clear how I access the value of sfdid (the first value in each row of my RowSetDynaClass). The examples talk about getId() and getListIndex(), but it is not at all clear which one is the value of a specific object - if either one of them actually are that.  
 
Please let me know if I can provide any additional info
 
Thanks,
Courtenay
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: courtenayt
Solution Provided By: mrcoffee365
Participating Experts: 1
Solution Grade: A
Views: 269
Translate:
Loading Advertisement...
01.24.2007 at 10:55AM PST, ID: 18388696

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2007 at 09:05AM PST, ID: 18397175

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2007 at 09:43AM PST, ID: 18397541

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2007 at 11:13AM PST, ID: 18398401

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2007 at 12:09PM PST, ID: 18398896

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2007 at 01:44PM PST, ID: 18399638

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.25.2007 at 02:27PM PST, ID: 18399982

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.27.2007 at 10:32AM PST, ID: 18411227

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.27.2007 at 11:37AM PST, ID: 18411457

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.29.2007 at 11:01AM PST, ID: 18421870

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.29.2007 at 11:56AM PST, ID: 18422303

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.29.2007 at 12:44PM PST, ID: 18422769

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.29.2007 at 06:44PM PST, ID: 18424785

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 06:14AM PST, ID: 18427691

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 06:23AM PST, ID: 18427749

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 08:25AM PST, ID: 18428798

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 09:19AM PST, ID: 18429229

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 09:38AM PST, ID: 18429415

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 09:55AM PST, ID: 18429556

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 09:57AM PST, ID: 18429577

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 10:18AM PST, ID: 18429731

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 10:18AM PST, ID: 18429736

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 10:45AM PST, ID: 18429997

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 11:25AM PST, ID: 18430347

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 11:44AM PST, ID: 18430511

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 11:52AM PST, ID: 18430590

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 12:47PM PST, ID: 18431066

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 12:51PM PST, ID: 18431097

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 01:39PM PST, ID: 18431504

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.30.2007 at 02:18PM PST, ID: 18431810

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
01.24.2007 at 10:55AM PST, ID: 18388696

Rank: Guru

ListObject is in the original sample tag set of classes -- you need to include them in your classpath for the java file to compile.  You need them available to Tomcat for the wrapper to run.

It looks as if you copied one file out of the org.displaytag.sample directory and renamed it to your package.  That's fine, but now the sample file is expecting all of the classes it uses out of org.displaytag.sample.  Either copy the rest of them to your teska.displaytag directory, or change the imports in your personal version of the wrapper to refer to the displaytag.sample classes from that other classpath.

Like:
import org.displaytag.sample.*;

I haven't used the displaytag decorator classes, so I'm not sure how you get the fields.  You have code in your wrapper -- did you create this?:

String sfdid = (currRowObject.getSfdid());

That seems to get the sfdid, but I can't see in your code where getSfdid() is defined.


 
01.25.2007 at 09:05AM PST, ID: 18397175
Thanks so much!  Can you tell me where I can get the org.displaytag.sample files?  I only had the code for the wrapper because someone posted it on a help forum I had read.  I really appreciate your help.  I find the displaytag website documentation completely useless.  The code that I do have working (to display the table) is nothing like their examples - I can't get anything from their examples to work - I always have to get online help from users to get anywhere.  

I am using Resin instead of tomcat (my hosting company provides that).

I currently have the following jar files in my WEB-INF/lib directory:

commons-beanutils-bean-collections.jar
commons-beanutils.jar
commons-collections-3.2.jar
commons-lang-2.2.jar
commons-logging-1.1.jar
displaytag-1.1.jar
displaytag-export-poi-1.1.jsr
itext-1.4.jar

I tried adding import org.displaytag.sample.*;
to my Wrapper.java class, but I get the following error message:

500 Servlet Exception

Note: sun.tools.javac.Main has been deprecated.
/home/teska/public_html/sandbox1/WEB-INF/classes/teska/displaytag/Wrapper.java:22:
Package org.displaytag.sample not found in import.
import org.displaytag.sample.*;
       ^
1 error, 1 warning

Resin 2.1.16 (built Tue Feb 15 11:12:27 PST 2005)

I'm assuming this is because I don't have the right jar loaded in my WEb-INF/lib directory.  Ideally I could copy the files into my own package so I can modify them if needed - like I did to the Wrapper.java class.  

Also, do you know if there is any documentation on the classes in the sample package?  I haven't even seen where I can get the package let alone what is in it.

Thanks,
Courtenay
 
01.25.2007 at 09:43AM PST, ID: 18397541

Rank: Guru

Apparently you have to download the source for displaytag to get the samples.  See this page for the FAQ which tells you that (other people have wondered, apparently):
http://displaytag.sourceforge.net/10/faq.html

You can get the binary download of display taglib and the samples from here (also sourceforge):
http://displaytag.sourceforge.net/10/download.html

Getting the source download might help with the documentation problems, too.
 
01.25.2007 at 11:13AM PST, ID: 18398401
Thanks - I've finally found the sample code.

I took a look at the ListObject class that was re fenced in the dynamic link table decorator example, but it appears I misunderstood the example.  I thought the ListObject was a class that pulled in data from my displaytag table - I guess from the documentation it just randomly genereates data to put into a link - not very helpful.  

Do you know if there is any way within my Wrapper function to access the sfdid value row by row from my displaytag table based on my RowSetDynaClass called new_ncs?  The sfdid value is the first value in my RowSetDynaClass.  What I was hoping to do was access that value and then use it to query my database to get yet another value and append the sfdid and the new value to the link in my table.  I've tried posting 2 questions like this to the displaytag forum and one other question here, but no one seems to have any idea how to do this - I never get any answers from anyone on the displaytag forum - really frustrating!

Thanks,
Courtenay
 
01.25.2007 at 12:09PM PST, ID: 18398896

Rank: Guru

What error do you get when you try to access sfdid?  If you are not using ListObject, then what are you using?

You seem to make a call to getSfdid() -- where is it defined?
 
01.25.2007 at 01:44PM PST, ID: 18399638
I've been doing more searching on the displaytag forums to try and figure out what I'm supposed to be doing.  I've modified my Wrapper Class, but I'm still having problems.  Here is my latest code:

JSP Code:

<%
                                RowSetDynaClass new_ncs = ActionViewTables.newNCTableSC(sdid_string);
                             
%>      
                                <% request.setAttribute("new_ncs_sc", new_ncs); %>

                                <display:table name="requestScope.new_ncs_sc.rows" id="row" decorator="teska.displaytag.Wrapper">
                                    <display:column property="sfdid" title="ID" sortable="true"/>
                                    <display:column property="level" title="Level" sortable="true"/>
                                    <display:column property="form_name" title="Form Name" sortable="true"/>
                                    <display:column property="last_name" title="System Coordinator" sortable="true"/>
                                    <display:column property="date_submitted" title="Date Submitted" sortable="true" decorator="teska.displaytag.LongDateWrapper"/>                                                                      
                                    <display:column property="scNcViewLink" title="View" />                                    
                                </display:table>

Wrapper class code:

package teska.displaytag;

/**
* Licensed under the Artistic License; you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://displaytag.sourceforge.net/license.html
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*Originally from: package org.displaytag.sample;
*
*
*/


import java.text.DecimalFormat;
import java.util.*;
//import org.displaytag.sample.*;

import org.apache.commons.lang.time.FastDateFormat;
import org.displaytag.decorator.TableDecorator;


/**
* This class is a decorator of the TestObjects that we keep in our List. This class provides a number of methods for
* formatting data, creating dynamic links, and exercising some aspects of the display:table API functionality.
* @author epesh
* @author Fabrizio Giustina
* @version $Revision: 1.12 $ ($Author: fgiust $)
*
*
* Modified: getLink2() changed by C. Teska January 11, 2005
*/

public class Wrapper extends TableDecorator{



      public String sfdid;
      public String level;
      public String form_name;
      public String last_name;
      public String date_submitted;


      /**
      * Creates a new Wrapper decorator who's job is to reformat some of the data located in our TestObject's.
      */

      public Wrapper(){
            super();


      }


      public String getScNcViewLink(){
            Wrapper currRowObject = (Wrapper)getCurrentRowObject();
            String sfdid_temp = (currRowObject.getSfdid());
            return "<a href=/displayView.jsp?sfdid=" + sfdid_temp + ">View</a>";
      }

      public String getSfdid(){
            return sfdid;
      }

      public void setSfdid(String value){
            sfdid = value;
      }

      public String getLevel(){
            return level;
      }

      public void setLevel(String value){
            level = value;
      }

      public String getForm_name(){
            return form_name;
      }

      public void setForm_name(String value){
            form_name = value;
      }

      public String getLast_name(){
            return last_name;
      }

      public void setLast_name(String value){
            last_name = value;
      }

      public String getDate_submitted(){
            return sfdid;
      }

      public void setDate_submitted(String value){
            date_submitted = value;
      }

}//close class


This code produces the following error message:

500 Servlet Exception

javax.servlet.jsp.JspException
      at org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:161)
      at org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:643)
      at org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1549)
      at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1218)
      at _SC._nc_0lists__jsp._jspService(/sandbox1/SC/nc_lists.jsp:126)
      at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
      at com.caucho.jsp.Page.subservice(Page.java:506)
      at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
      at com.caucho.server.http.Invocation.service(Invocation.java:315)
      at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
      at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
      at java.lang.Thread.run(Thread.java:595)

Resin 2.1.16 (built Tue Feb 15 11:12:27 PST 2005)

According to the error message it appears the error is in the nc_lists.jsp code, but if I use the following code in the jsp (removing references to the Wrapper class), the table displays with no problem:

<%
                                RowSetDynaClass new_ncs = ActionViewTables.newNCTableSC(sdid_string);
                             
%>      
                                <% request.setAttribute("new_ncs_sc", new_ncs); %>

                                <display:table name="requestScope.new_ncs_sc.rows" id="row">
                                    <display:column property="sfdid" title="ID" sortable="true"/>
                                    <display:column property="level" title="Level" sortable="true"/>
                                    <display:column property="form_name" title="Form Name" sortable="true"/>
                                    <display:column property="last_name" title="System Coordinator" sortable="true"/>
                                    <display:column property="date_submitted" title="Date Submitted" sortable="true" decorator="teska.displaytag.LongDateWrapper"/>                                                                      
                                                                     
                                </display:table>
 
01.25.2007 at 02:27PM PST, ID: 18399982

Rank: Guru

I see that you're successfully using a wrapper called teska.displaytag.LongDateWrapper .  If you look at that, does it help with the nc_lists.jsp problem?

We might have to see the nc_lists.jsp code to get further diagnosing the problem.

One thing I saw on the displaytag forums was problems with variable types.  Is sfdid defined as a string?  Usually id fields are int or long, and I wonder if there's a type conflict there that is not happening when you use Date in the LongDateWrapper?
 
01.27.2007 at 10:32AM PST, ID: 18411227
Hi,

Thanks for the ideas. I tried changing the sfdid get and set methods to int instead of String.  The level and last_name and form_name are var_chars in my database (which pull out as Strings normally) and date_submitted is a timestamp with time zone.   I assume date_submitted is still a String, at least I've pulled it into the database that way in the past.  Unfortunately I still received the same error message as I did previously.  


 Here is my code for LongDateWrapper:

package teska.displaytag;

/**
* Licensed under the Artistic License; you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://displaytag.sourceforge.net/license.html
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDI