I would say your problem is getting the web page to update from
a applet. This is a nonsense because you will force the enitre applet 
to also reload as the web page reload!!

But if you use frames then you need to force the applet to display
the web frame after invoking the servlet. I don't think there is a way
to request a servlet and redirect the output to go a separate HTML Frame.

A better way is to make applet display the info from the servlet.
You could use HTTP Tunnelling to transmit Java objects to and from
the applet and servlet.



[EMAIL PROTECTED] wrote:
> 
> Hi,
> 
>   I was trying to connect to a servlet through an applet.I created an html
> page with two frame.At the top frame the applet was embedded and in the bottom
> frame the servlet was server side included.I used the GET method to
> communicate to the servlet.So in the init method of the applet I added the
> following code to get a connection to the servlet.And pass information through
> the URL.
> ////////////////////////////////////////////////////////
> 
>  String
> 
>servletLocation="http://172.100.8.213:8080/servlet/serv.HelloWorldServlet1?LastName='Jones'";
> try{
>  testServlet = new URL( servletLocation );
> }
> catch (MalformedURLException e){
> }
> 
> try{
> servletConnection = testServlet.openConnection();
> }
> catch(IOException e){
> }
> 
> ///////////////////////////////////////////////////////////////////////
> The code of the servlet is shown below,where I tried to get the information
> passed from the applet
> 
> public class HelloWorldServlet1 extends HttpServlet {
> 
> 
>     public void doGet (HttpServletRequest req, HttpServletResponse res)
>     throws ServletException, IOException
>     {
>         PrintWriter             out;
> 
>         res.setContentType("text/html");
>         out = res.getWriter();
>   String name=req.getParameter("LastName");
> 
>         out.println("<html>");
>         out.println("<head><title>Hello World</title></head>");
>         out.println("<body>");
>         out.println("<h1>LastName="+name+"</h1>");
>         out.println("</body></html>");
>     }
> }
> /////////////////////////////////////////////
> 
> The output is showing a null value for the name.Is it wrong to send the
> information to the servlet from the init method.Can you suggest some other
> method or simple code for the communication.
> 
> regards,
> Rakesh.
> 
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

-- 

mfg
Peter

======================================================================
"The greatest trick the devil ever pulled was making everyone in the
world believe he didn't exist."         Kevin Spacey as Kaiser Soze


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to