Is the code you've posted exactly as it really is? If so, the problem may be in
this line:

>             "<APPLET CODE=MultiList.class"+
>               "codebase=\".\""+
>               "width=430"+
>               "height=410>"+

which when sent to the browser will come out like this

<APPLET CODE=MultiList.classcodebase="."width=430height=410>

Not having spaces between 'class' and 'codebase' will cause a problem. Rewrite
it to put spaces between the parameters, add escaped quotes around all the
values, and see if that works.

K Mukhar

Ryan Richards wrote:
>
> I have been battling this Servlet Applet problem off and on and cannot figure out 
>what is causing this problem. Here is my servlet code:
>
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
>
> public class pageGenerator extends HttpServlet
>                                     implements SingleThreadModel {
>
>   public void init( ServletConfig config ) throws ServletException {
>     super.init(config);
>   }
>
>   public void doGet( HttpServletRequest req,
>                       HttpServletResponse res )
>     throws ServletException, IOException {
>
>         // Setup the stream
>         PrintWriter out = res.getWriter();
>         res.setContentType("text/html");
>
>         out.println(
>           "<HTML>"+
>           "<TITLE>Multiple Well Selection Form</TITLE>"+
>           "<BODY>"+
>            "<CENTER>"+
>             "<APPLET CODE=MultiList.class"+
>               "codebase=\".\""+
>               "width=430"+
>               "height=410>"+
>             "</APPLET>"+
>            "</CENTER>"+
>           "</BODY>"+
>           "</HTML>"
>         );
>         out.close();
>   }
> }
>
> I keep getting this error in java console:
>
> # Applet exception: error: java.lang.ClassFormatError: Bad magic number
>
> If I print the html out as ascii it loads the applet fine!
>
> Any help would be appreicated!

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to