cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Lilienthal" <lilient...@webdesign4free.de>
Subject Three-tier-application?
Date Sat, 29 Jan 2000 21:37:25 GMT
Hi,

i want to build a so called "Three-tier webapplication". A servlet creates a xml-page, that
should be converted to html by cocoon. 

What to do?

Here`s some servlet code:

package test;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class testServlet extends HttpServlet {

  file://Initialize global variables
  public void init(ServletConfig config) throws ServletException {
    super.init(config);
  }

  file://Process the HTTP Get request
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
    response.setContentType("text/html");
    PrintWriter out = new PrintWriter (response.getOutputStream());
    out.println("<?xml version=\"1.0\"?>");
    out.println("<?xml-stylesheet href=\"/hello.xsl\" type=\"text/xsl\"?>");
    out.println("<?cocoon-process type=\"xslt\"?>");
    out.println("<page>");
    out.println("<title>Testpage!</title>");
    out.println("<content>");
    out.println("<paragraph>package test;</paragraph>");
    out.println("</content>");
    out.println("</page>");
}



  file://Get Servlet information
  public String getServletInfo() {
    return "testServlet Information";
  }

 
  }



 How can I transform the output to HTML?



thanks in advance


Martin Lilienthal

Mime
View raw message