I am posting from a login.jsp that calls a
servlet and I need to get the response of that servlet and send it to another
jsp page called template.jsp
here is the code in my servlet
this is in the doPost() method::::
response.sendRedirect("http://" + req.getHeader("host") + "/" + "star/template.jsp");
here is code::::using
tomcat <%@page import="javax.xml.parsers.DocumentBuilderFactory,java.net.*,java.io.*,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*" %>
<html>
<head>
<title>My first template</title>
</head>
<body>
<%
InputStream in = request.getInputStream();//trying to get the inputstream back from servlet and parse it, right now I have this path hardcoded in the parse function and it works but how can I grab this
string from the servlet. and pass it directly into the parse and build my DOM??
out.println(in);
DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
DocumentBuilder db=dbf.newDocumentBuilder();
Document doc=db.parse("http://rsmilgius:8080/star/employee.xml");//need to use InputStream from servlet any ideas???
NodeList idNl=doc.getElementsByTagName("id");
NodeList nameNl=doc.getElementsByTagName("name");
%>
The Data Response from IDS<p/>
<%
for(int i=0;i<nameNl.getLength();i++)
{
String idname=idNl.item(i).getNodeName();
String idvalue=idNl.item(i).getFirstChild().getNodeValue();
String name=nameNl.item(i).getNodeName();
String nvalue=nameNl.item(i).getFirstChild().getNodeValue();
out.println(idname+"=>"+idvalue+" "+name+"=>"+nvalue+"<BR>");
}
%>
</body>
</html>
Thanks in advance Ray Smilgius
[This message has been edited by Ray Smilgius (edited November 12, 2001).]