Boa noite !!
Você fala do Welcome file List
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
ou na configuração do filtro do Struts
<filter>
<filter-name>Struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<filter>
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Pois no Welcome File List eu coloquei as tags
<welcome-file>default.png</welcome-file>
<welcome-file>default.jpg</welcome-file>
E continuou nao aparecendo o Grafico Segue abaixo os codigos do Struts.xml e da action
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" extends="struts-default, jfreechart-default">
<action name="grafico" class="evaristo.teste.chart.action.MyChartAction">
<result name="ok" type="chart">
<param name="value">chart</param>
<param name="type">png</param>
<param name="width">640</param>
<param name="height">480</param>
</result>
</action>
</package>
</struts>
Action
package evaristo.teste.chart.action;
/*import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;*/
import org.jfree.chart.JFreeChart;
import com.opensymphony.xwork2.ActionSupport;
import teste.chart.Chart;
public class MyChartAction extends ActionSupport {
private JFreeChart chart;
// @Action(value="chart", results={
// @Result(name="ok",location="/teste.jsp")
// })
public String execute(){
System.out.println("cheguei ");
Chart c = new Chart();
/*chart = c.criaChart();*/
setChart(c.criaChart());
return "ok";
}
private JFreeChart getChart() {
return chart;
}
private void setChart(JFreeChart chart) {
this.chart = chart;
}
}
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<table border="2" align="center">
<tr>
<td >
"Ola MundO"
<img src="chart.jsp">
</td>
</tr>
</table>
</body>
</html>
chart.jsp
<% response.sendRedirect("grafico");%>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>StrutsChartXML</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
<welcome-file>default.png</welcome-file>
<welcome-file>default.jpg</welcome-file>
</welcome-file-list>
<filter>
<filter-name>Struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class><!--
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
--></filter>
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Obrigado pela ajuda !!