Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem in using display.tld to export data to excel

807600Sep 26 2007 — edited Sep 26 2007
Hi all,

i am trying to use the displaytag 1.1 to export some data to excel. but i am facing some difficulties with that.

this is in struts 1.1 and i am using weblogic 8.1 and i included the displaytag.tld and the displaytag.jar file as well.
when i am deploying the control flows fine up until the jsp page where i included the displaytag

it gives the error

Parsing of JSP File '/Success.jsp' failed:
--------------------------------------------------------------------------------
/Success.jsp(9): Error in using tag library uri='/tags/display' prefix='display': For tag 'table', cannot load extra info class 'org.displaytag.tags.TableTagExtraInfo'
probably occurred due to an error in /Success.jsp line 9:
<%@ taglib uri="/tags/display" prefix="display" %>


my Success.jsp page is here below::

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ taglib uri="struts-bean.tld" prefix="bean" %>
<%@ taglib uri="struts-html.tld" prefix="html" %>
<%@ taglib uri="/tags/display" prefix="display" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>Success</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>

HELLO!


<%


//session=request.getSession();
//Object obj1=session.getAttribute("fname");
//Object obj2=session.getAttribute("lname");
//out.println(obj1);
//out.println(obj2);

String fname=(String)session.getAttribute("fname");
String lname=(String)session.getAttribute("lname");
String business=(String)session.getAttribute("business");

out.println("YOUR FIRST NAME IS ::" +fname);

out.println("\nYOUR LAST NAME IS ::"+lname);

out.println("\nYOUR BUSINESS IS ::"+business);

%>
<!--
<display:table name="CustomerDetails" pagesize="5" export="true"
requestURI="http://localhost:7001/ExportExcel/CustomerAction.do">
<display:column property="fname" title="FirstName"/>
<display:column property="lname" title="LastName"/>
<display:column property="business" title="Business"/>
</display:table>
-->

</body>
</html>

the basic goal is to print some name (like firstname and lastname) on the jsp, i am using session for that.

another thing is i made one displaytag.property file where i am specifying tthe .xls filename (is it needed to give a filename in advance or it will promt for a filename?) and export types (like excel=true and csv=false). is it necessary to do so? if yes then how it is working?


i've added the following entries in web.xml

<filter>
<filter-name>ResponseOverrideFilter</filter-name>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ResponseOverrideFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ResponseOverrideFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

even if i comment the <display:table/> code still it is giving the same error.

i need to make this code work!!!!
PLEASE advise what are the changes i have to make in order to get this right.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2007
Added on Sep 26 2007
4 comments
59 views