please look at the code . I am trying to include one .jsp and making
the current thread to sleep for 5 sec then icluding one more jsp. But
both included jsps coming to screen same time > i included the code for
your refernce guys.
Thanks
Prem
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorldExample extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = new PrintWriter(response.getWriter(),true);
String inxml="HelloWOrld";
request.setAttribute("myData", inxml );
getServletConfig().getServletContext().getRequestDispatcher("/jsp/test.jsp").include(request,
response);
try
{
System.out.println("Entering into the loop 1");
Thread.currentThread().sleep(5000);
}
catch(Exception ex1)
{
System.out.println(ex1.getMessage());
}
String inxml1="Helo WOrld1";
request.setAttribute("myData1", inxml1 );
getServletConfig().getServletContext().getRequestDispatcher("/jsp/test1.jsp").include(request,
response);
}
}
test.jsp
========
<%
String s =(String)request.getAttribute("myData");
out.println(s);
%>
test1.jsp
========
<%
String s1 = (String)request.getAttribute("myData1");
out.println(s1);
%>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com