Hi dear,

I have an app that generate with Struts/ Actions Class a XML file.
For example:

Java Code:
package br.com.accessconsult.struts.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import br.com.accessconsult.jdbc.dao.LivrosDAO;
import br.com.accessconsult.jdbc.modelo.Livros;

public class livrosJSP extends Action {
	@Override
	public ActionForward execute(ActionMapping map, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String pesq = request.getParameter("pesq");
		//System.out.println(pesq);
		Long isbn = null;
		
		//response.setHeader(arg0, arg1);
		
		if (!pesq.equals(""))
			isbn = Long.parseLong(pesq);
		
		Livros l = new Livros();
		l.setIsbn(isbn);
		
		LivrosDAO dao = new LivrosDAO();
		List <Livros> livros = dao.getLista(l);
		
		String xml = "<livros>\n";
		
		for(int index = 0;index<livros.size();index++){//while (!livros.isEmpty()) {
			Livros livro = livros.get(index);
			xml += "<livro>\n";
			xml += "<isbn>"			+ livro.getIsbn() 			+ "</isbn>\n";
			xml += "<titulo>"		+ livro.getTitulo() 		+ "</titulo>\n";
			xml += "<edicao>"		+ livro.getEdicao_num() 	+ "</edicao>\n";
			xml += "<publicacao>"	+ livro.getAno_publicacao() + "</publicacao>\n";
			xml += "</livro>\n";
		}
		xml += "</livros>\n";
		
		request.setAttribute("xml", xml);		
		return map.findForward("OK");
	}
}
and I create a JSP file that display the content:

Java Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<%@ page contentType="text/xml"%>
${xml}
however dear, how do I do to configure and work the function on my Struts Action Class:
Java Code:
response.setHeader()
I made this:

Java Code:
package br.com.accessconsult.struts.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import br.com.accessconsult.jdbc.dao.LivrosDAO;
import br.com.accessconsult.jdbc.modelo.Livros;

public class autoresJSP extends Action {
	@Override
	public ActionForward execute(ActionMapping map, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		response.setHeader("Cache-Control", "no-cache");//Http 1.1
		response.setHeader("Pragma","no-cache");//Http 1.0		
		response.setDateHeader("Expires", -1);
		
		
		String xml = "";
		request.setAttribute("xml", xml);		
		return map.findForward("OK");
	}
}
to test, and the JSP dont found the headers configuration on my Struts Class.

Dear, how can I do to JSP run correctly receivering the headers configs by Struts Class?

Thanks in advance.