paddyfitz2005
asked on
output a jsp page from a servlet
i'm trying to output a jsp page from a servlet but it won't display properly, anyone any ideas how i can display it as a jsp:
This is the code in the servlet
response.setContentType("t
out.println("<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>");
out.println("<%@ page contentType='text/html; charset=iso-8859-1' language='java' import='java.sql.*' errorPage='' %>");
out.println("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
out.println("<html xmlns='http://www.w3.org/1999/xhtml'>");
out.println("<HEAD>");
out.println("<TITLE>JFreeC
out.println("</HEAD>");
out.println("<BODY>");
out.println("<%@ include file='/chart1.jspf'%>");
out.println("<H2>JFreeChar
out.println("<P>");
out.println("Please choose a chart type:");
out.println("<FORM ACTION=\"ServletDemo2\" METHOD=POST>");
String pieChecked = (param.equals("pie") ? " CHECKED" : "");
String barChecked = (param.equals("bar") ? " CHECKED" : "");
String timeChecked = (param.equals("time") ? " CHECKED" : "");
out.println("<INPUT TYPE=\"radio\" NAME=\"chart\" VALUE=\"pie\"" + pieChecked
+ "> Pie Chart");
out.println("<INPUT TYPE=\"radio\" NAME=\"chart\" VALUE=\"bar\"" + barChecked
+ "> Bar Chart");
out.println("<INPUT TYPE=\"radio\" NAME=\"chart\" VALUE=\"time\"" + timeChecked
+ "> Time Series Chart");
out.println("<P>");
out.println("<INPUT TYPE=\"submit\" VALUE=\"Generate Chart\">");
out.println("</FORM>");
out.println("<P>");
out.println("<IMG SRC=\"ServletDemo2ChartGen
+ "\" BORDER=1 WIDTH=400 HEIGHT=300/>");
out.println("<%@ include file='/chart2.jspf'%>");
out.println("</BODY>");
out.println("</HTML>");
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.