You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matts <ma...@hotmail.com> on 2006/09/04 15:45:57 UTC

Struts tiles cewolf problem

Hi, I'm developing a web app with struts, tiles. I want to use cewolf to render chart. It's work fine if i don't use tiles.
The problem is that with tiles the chart are not show.

Any one nows how to integrate correctly with tiles??

Re: Struts tiles cewolf problem

Posted by Matts <ma...@hotmail.com>.
Here's the web.xml (its works without tiles):
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 
2.3//EN"

"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<display-name>Cewolf</display-name>

<servlet>

<servlet-name>action</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

<init-param>

<param-name>config</param-name>

<param-value>/WEB-INF/struts-config.xml</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>


<servlet>

<servlet-name>CewolfServlet</servlet-name>

<servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>


<servlet-mapping>

<servlet-name>action</servlet-name>

<url-pattern>*.do</url-pattern>

</servlet-mapping>



<servlet-mapping>

<servlet-name>CewolfServlet</servlet-name>

<url-pattern>/cewolf/*</url-pattern>

</servlet-mapping>



<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>

<taglib>

<taglib-uri>/WEB-INF/struts-bean</taglib-uri>

<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-logic</taglib-uri>

<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-html</taglib-uri>

<taglib-location>/WEB-INF/struts-html.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/c</taglib-uri>

<taglib-location>/WEB-INF/c.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/fmt</taglib-uri>

<taglib-location>/WEB-INF/fmt.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-tiles</taglib-uri>

<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-nested</taglib-uri>

<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>

</taglib>

</web-app>

----- Original Message ----- 
From: "Antonio Petrelli" <br...@tariffenet.it>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, September 04, 2006 11:27 AM
Subject: Re: Struts tiles cewolf problem


> Matts ha scritto:
>> It's work fine if i don't use tiles.
>> The problem is that with tiles the chart are not show.
>>
>
> I don't see anything wrong with your file. What do you exactly mean with 
> "the charts are not shown"? The page is completely blank? There is a 
> missing piece of the page? Images are not shown, and you see a "broken 
> image" in your result?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts tiles cewolf problem

Posted by Matts <ma...@hotmail.com>.
The result with tiles is this: image is not show. Its appear with an "X". 
Here's a capture.

----- Original Message ----- 
From: "Antonio Petrelli" <br...@tariffenet.it>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, September 04, 2006 11:27 AM
Subject: Re: Struts tiles cewolf problem


> Matts ha scritto:
>> It's work fine if i don't use tiles.
>> The problem is that with tiles the chart are not show.
>>
>
> I don't see anything wrong with your file. What do you exactly mean with 
> "the charts are not shown"? The page is completely blank? There is a 
> missing piece of the page? Images are not shown, and you see a "broken 
> image" in your result?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


Re: Struts tiles cewolf problem

Posted by Antonio Petrelli <br...@tariffenet.it>.
Matts ha scritto:
> It's work fine if i don't use tiles.
> The problem is that with tiles the chart are not show.
>   

I don't see anything wrong with your file. What do you exactly mean with 
"the charts are not shown"? The page is completely blank? There is a 
missing piece of the page? Images are not shown, and you see a "broken 
image" in your result?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [tiles] Re: Struts tiles cewolf problem(Resolved)

Posted by Matts <ma...@hotmail.com>.
You thinks well antonio!! It has worked without the <html:base> tag!!!!! 
Thank you very much.
I will try now to integrate it with the real application, and I think I will 
have problems removing <html:base> cause I have other resourses that need 
it!!! But well that is another theme!! thanks

----- Original Message ----- 
From: "Antonio Petrelli" <br...@tariffenet.it>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, September 04, 2006 11:40 AM
Subject: Re: [tiles] Re: Struts tiles cewolf problem


> Matts ha scritto:
>> Layout1(at web-inf/tiles):
>> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>
>> <%@ taglib uri="http://struts.apache.org/tags-tiles"
>> prefix="tiles" %>
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>>
>> <HTML>
>>
>> <HEAD>
>>
>> <TITLE><tiles:getAsString name="title"/></TITLE>
>>
>> <html:base/>
>
> Hehe! I (think I) got it!
> This is the "infamous" <html:base /> tag that, with Tiles, uses your 
> layout JSP page as the base path, I still don't know why. (Just check your 
> produced HTML and look at the <base> tag).
> In these cases I suggest to remove the <html:base/> tag and use only 
> relative paths.
>
> HTH
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [tiles] Re: Struts tiles cewolf problem

Posted by Antonio Petrelli <br...@tariffenet.it>.
Matts ha scritto:
> Layout1(at web-inf/tiles):
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <%@ taglib uri="http://struts.apache.org/tags-tiles"
> prefix="tiles" %>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <HTML>
>
> <HEAD>
>
> <TITLE><tiles:getAsString name="title"/></TITLE>
>
> <html:base/>

Hehe! I (think I) got it!
This is the "infamous" <html:base /> tag that, with Tiles, uses your 
layout JSP page as the base path, I still don't know why. (Just check 
your produced HTML and look at the <base> tag).
In these cases I suggest to remove the <html:base/> tag and use only 
relative paths.

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [tiles] Re: Struts tiles cewolf problem

Posted by Matts <ma...@hotmail.com>.
Layout1(at web-inf/tiles):
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<%@ taglib uri="http://struts.apache.org/tags-tiles" 

prefix="tiles" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<TITLE><tiles:getAsString name="title"/></TITLE>

<html:base/>

</HEAD>

<BODY bgcolor="#CCCCCC">

<TABLE border="0" width="765" cellspacing="5" align="center">

<TR>

<TD valign="top" align="left">

<tiles:insert attribute='body' />

<br clear="ALL">

</TD>

</TR>

</TABLE>

</BODY>

</HTML>

----- Original Message ----- 
From: "Antonio Petrelli" <br...@tariffenet.it>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, September 04, 2006 11:16 AM
Subject: Re: [tiles] Re: Struts tiles cewolf problem


> Matts ha scritto:
>> <definition name=".layout1" path="/WEB-INF/tiles/layout1.jsp">
> 
> Can you post also layout1.jsp please?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [tiles] Re: Struts tiles cewolf problem

Posted by Antonio Petrelli <br...@tariffenet.it>.
Matts ha scritto:
> <definition name=".layout1" path="/WEB-INF/tiles/layout1.jsp">

Can you post also layout1.jsp please?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [tiles] Re: Struts tiles cewolf problem

Posted by Matts <ma...@hotmail.com>.
My tiles-def.xml looks like:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles 
Configuration 1.1//EN"

"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">

<tiles-definitions>

<!-- layout1: utilizado en la pagina de login -->

<definition name=".layout1" path="/WEB-INF/tiles/layout1.jsp">

<put name="title"/>

<put name="body"/>

</definition>

<definition extends=".layout1" name="greeting.page">

<put name="title" value="Greeting"/>

<put name="body" value="/WEB-INF/tiles/body-greeting.jsp"/>

</definition>

</tiles-definitions>

The page that is supposed to show the chart is greeting.jsp wich has the 
body body-greeting.jsp.
greeting. jsp (at web-root/pages):
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<tiles:insert definition="greeting.page"/>

body-greeting.jsp (at web-inf/tiles):
<%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %>


<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td>

<h1><%=request.getAttribute("greeting")%></h1>

</td>

</tr>

</table>

<jsp:useBean id="pageViews" class="logica.PageViewCountData"/>

<cewolf:chart id="line" title="Page View Statistics" type="line" 
xaxislabel="Page" yaxislabel="Views">

<cewolf:data>

<cewolf:producer id="pageViews"/>

</cewolf:data>

</cewolf:chart><p>

<cewolf:img chartid="line" renderer="cewolf" width="400" height="300"/>

<P>

thanks for reply.
Matts.

----- Original Message ----- 
From: "Antonio Petrelli" <br...@tariffenet.it>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, September 04, 2006 10:59 AM
Subject: [tiles] Re: Struts tiles cewolf problem


> Matts ha scritto:
>> Hi, I'm developing a web app with struts, tiles. I want to use cewolf to 
>> render chart. It's work fine if i don't use tiles.
>> The problem is that with tiles the chart are not show.
>>
>> Any one nows how to integrate correctly with tiles??
>>
>
> Do you use Tiles definitions? If yes can you post them here, along with 
> layout pages and the JSP page supposed to show the chart?
> Do you receive any exception? If yes, can you post them?
>
> Ciao
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[tiles] Re: Struts tiles cewolf problem

Posted by Antonio Petrelli <br...@tariffenet.it>.
Matts ha scritto:
> Hi, I'm developing a web app with struts, tiles. I want to use cewolf to render chart. It's work fine if i don't use tiles.
> The problem is that with tiles the chart are not show.
>
> Any one nows how to integrate correctly with tiles??
>   

Do you use Tiles definitions? If yes can you post them here, along with 
layout pages and the JSP page supposed to show the chart?
Do you receive any exception? If yes, can you post them?

Ciao
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org