BZJavaInst
Programmer
I was able to create an Applet that sends Data in an Serialized Object to a Servlet and then return the data back to the Applet. I am using both the ObjectOutputStream and ObjectInputStream to do this. However when I tryed to build HTML in my doPost and send it back to the Browser, the HTML did not execute. Only the Applet remained in the Browser. Does any know why this is?
I am using the JSDK2.1. I also tryed using the PrintWriter with the response.getWriter() and I had no luck. It does work if I call the doPost from an HTML instead of the Applet. I even tryed it with response.getOutputStream() with no luck.
sample code:
// htmlPage is a String with the HTML code
PrintWriter outputBR = new PrintWriter(response.getOutputStream()); // or response.getWriter();
response.setContentType("text/html"
outputBR.println(htmlPage);
outputBR.close();
If I use in the Applet a BufferedReader and get the Servlet response, the String that is returned by my readLine() shows the HTML code sent, but I need it to execute in the Browser and not be sent to the Applet.
Can any Help? Is this possible? Thanks, Brian.
I am using the JSDK2.1. I also tryed using the PrintWriter with the response.getWriter() and I had no luck. It does work if I call the doPost from an HTML instead of the Applet. I even tryed it with response.getOutputStream() with no luck.
sample code:
// htmlPage is a String with the HTML code
PrintWriter outputBR = new PrintWriter(response.getOutputStream()); // or response.getWriter();
response.setContentType("text/html"
outputBR.println(htmlPage);
outputBR.close();
If I use in the Applet a BufferedReader and get the Servlet response, the String that is returned by my readLine() shows the HTML code sent, but I need it to execute in the Browser and not be sent to the Applet.
Can any Help? Is this possible? Thanks, Brian.