Re: Problem with importing package in JSP

2001-05-28 Thread Christopher Benson

Kris,

You're missing the @ sign.  You wrote:

% page import=3Dpackage.name.* %

It should be:

%@ page import=3Dpackage.name.* %

Take care,
Christopher Benson




Re: port 8080 to port 80?

2001-05-18 Thread Christopher Benson



You'll find what 
you're looking for in the server.xml file in the conf 
directory.



Tomcat 4 as an NT/2000 Service

2001-05-17 Thread Christopher Benson



Does anyone know 
when a version ofjk_nt_service.exe for Tomcat 4.x will be available so 
that Tomcat 4 can be run as an NT/2000 Service? Alternatively, is there a 
way the current jk_nt_service.exe can work with Tomcat 4. Tomcat 4 has no 
workers.properties file which is required by 
jk_nt_service.exe.

Thanks,
Chris



Problem with JSP in Tomcat calling JavaBean that uses Xalan 2

2001-05-07 Thread Christopher Benson



I created a bean 
that can be called from a JSP or by directly instantiating it 
frommain(). The bean uses an XML file and an XSLT file, both of 
which are valid. When I run the bean using the main() method, it works 
correctly and prints the correct HTML output to the console. However, when 
I call the bean from the JSP below in Tomcat, it gives me the following 
error:

java.lang.IllegalStateException: Response has already been 
committed

I already know that 
an IllegalStateException"signals that a method has been invoked at an 
illegal or inappropriate time. In other words, the Java environment or Java 
application is not in an appropriate state for the requested 
operation."

I don't know how to 
solve it though. Any ideas?

Thanks,
Christopher 
Benson
[EMAIL PROTECTED]
=
package 
com.christopherbenson;

import 
java.io.*;import javax.xml.transform.*;import 
javax.xml.transform.stream.*;

public class 
TransformationBean{

 public 
TransformationBean(){}

 public static 
void main(String[] args) throws Exception 
{ TransformationBean bean = new 
TransformationBean(); try 
{ 
bean.setXMLdoc("C:/Temp/test.xml"); 
bean.setXSLTdoc("C:/Temp/test.xsl"); String x 
= bean.getResult(); 
System.out.println(x); } catch 
(Exception e) { 
System.out.println(e.toString()); } 
}

 private 
String xmlsource = null; private String xsltsource = 
null;

 public void 
setXMLdoc(String xmldoc) throws FileNotFoundException, 
IOException { BufferedReader in = new 
BufferedReader(new FileReader(xmldoc)); String s, s2 = new 
String(); while((s = in.readLine())!= 
null) s2 += s + "\n"; 
in.close(); xmlsource = s2; 
}

 public void 
setXSLTdoc(String xsltdoc) throws FileNotFoundException, 
IOException { BufferedReader in = new 
BufferedReader(new FileReader(xsltdoc)); String t, t2 = 
new String(); while((t = in.readLine())!= 
null) t2 += t + "\n"; 
in.close(); xsltsource = t2;

 }

 public String getResult() throws 
TransformerException, 
TransformerFactoryConfigurationError, 
TransformerConfigurationException, IOException //SAXException 
{ try 
{ TransformerFactory tFactory = 
TransformerFactory.newInstance(); Transformer 
transformer = tFactory.newTransformer(new StreamSource(new 
StringReader(xsltsource))); StringWriter 
resultWriter = new StringWriter(); 
StreamResult TheResult = new 
StreamResult(resultWriter); 
transformer.transform(new StreamSource(new StringReader(xmlsource)), 
TheResult); String result = 
resultWriter.toString(); return 
result; } catch (Exception 
e) { String result = 
e.getMessage(); return 
result; } }

}=

%@ page language="java" 
%jsp:useBean id="bean" 
class="com.christopherbenson.TransformationBean" 
/%bean.setXMLdoc("C:/Temp/test.xml");bean.setXSLTdoc("C:/Temp/test.xsl");String 
result = bean.getResult();out.println(result);%

=