• Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet-servlet communication

 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
here is my code,
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class AppletViaServlet extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException,IOException {
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();
out.println("<html><head>");
out.println("<title> Marketers Servlet Application </title>");
out.println("<base href=\"http://localhost:8080/MyServlets\">");
out.println("</head>");
out.println("<body>");
out.println("<applet code=\"/AppletEx.class\" width=500 height=200>");
out.println("</applet>");
out.println("</body></html>");
out.close();
}
}
my applet is not getting loaded. Can anybody help me out?
thanks in advance.
regards.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can you try this

Hope you place AppletEx.class in MyServlets folder.
----------------
Sainudheen
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot mydeen, it works. Can u tell me why it did not work when i used 'base href' within <head></head> tags.[/LIST]Sun Certified Programmer.
 
Sanjeev Kaushik
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this link can help you
http://www.geocities.com/siliconvalley/lakes/8620/applettag.html
Regards,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!