Hi,
is it possible to call a threads directly from a jsp page ?
can a bean be a thread by itself ?
Pls look at the following code and tell me what is wrong ?
right.jsp
<%@ page autoFlush="true" import = "ReadMessages"%>
<jsp:useBean id="mb" class="oracle.mailClient.ReadMessages"
scope="application"/>
<%
PrintWriter writer= response.getWriter();
mb.setParameter(writer);
mb.start();
%>
ReadMessage.java (is a bean)
class ReadMessage extends Thread
{
private PrintWriter w;
public void run()
{
showMessage();
}
public void setParameter(PrintWriter w)
{
this.w=w;
}
public void showMessage()
{
w.println("Hi Everybody........");
}
}
Problem is , thread is running but the message is not displayed on the
page :( why is this ?
Where i am going wrong ?
I am using TOMCAT to run.
Thanx in advance
Rakesh.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets