• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't get an applet to work inside a Webapp!  RSS feed

 
Mike London
Ranch Hand
Posts: 1505
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Tomcat 5.0, I have an Applet that works fine under the non-Webapp way of doing things in Tomcat (not a Webapp, but classes and JSPs were put in Tomcat's other directories).

However, when I move the application, including the applet, into a WebApp, I'm having problems.

I created a separate directory outside WEB-INF for the applet itself. The applet comes up and seems to work OK.

The part that isn't working in the applet is the part where I try to create a URL object so I can communicate with the Servlet.

For some reason, no matter what I put in the WEB.XML file for either the mapping or class name for the Servlet the applet tries to communicate with, I keep getting the message in the Tomcat log that:

java.lang.ClassNotFoundException: MyAppName.HomeServlet

The home servlet is in the directory WEB-INF\classes\MyAppName\HomeServlet.class

The Web.xml file has the following:

<servlet>
<servlet-name>HomeServlet</servlet-name>
<servlet-class>MyAppName.HomeServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HomeServlet</servlet-name>
<url-pattern>/HomeServlet</url-pattern>
</servlet-mapping>

The URL Object I'm using to try to create the connection to the Servlet is:

String urlSuffix=
"/servlet/MyAppName.HomeServlet" ;

I've tried with and without the "servlet/" piece.

====================

I hope this is enough info.

I would greatly appreciate any thoughts and info on this.

Thanks very much.

-- Mike
 
Mike London
Ranch Hand
Posts: 1505
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed this problem.

It was a matter of getting a Applet to work inside a Webapp.

Not fun..



-- Mike
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!