• Post Reply Bookmark Topic Watch Topic
  • New Topic

sending an applet in a html document using servlet

 
bhagavatula indu sekhar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the following is the source code of the servlet.

public class servletapplet extends GenericServlet
{

public void service( ServletRequest req, ServletResponse res ) throws ServletException,IOException
{
PrintWriter pw=new PrintWriter(res.getWriter() );
res.setContentType("text/html");

pw.println("<html><body><applet code=\"japplet1.class\" > </applet> </body></html>");

try
{
pw.close();
}
catch(Exception ioe)
{
JOptionPane.showMessageDialog(null,"Error1");
}
}
}


the server used is jsdk2.1

the applet and the servlet are in the same directory i.e in

the applet is present in the servlets directory of web-inf of webpages directory.

when the servlet is executed there is no applet executed.

how do i send an applet in a html document using servlet?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The WEB-INF (not web-inf) directory is not accessible to browsers.
You'll need to move your applet resources into a directory that can be seen from the web.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!