aspose file tools*
The moose likes Applets and the fly likes Applet as jsp plugin (Tomcat) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet as jsp plugin (Tomcat)" Watch "Applet as jsp plugin (Tomcat)" New topic
Author

Applet as jsp plugin (Tomcat)

Rudolf Hergat
Greenhorn

Joined: Jun 21, 2012
Posts: 6
Hey, I'm kinda new to applets and jsp. I want to make my applet run from Tomcat, as a plugin in a jsp page. My problem is, that when I want to load the page, the applet doesn't load. I get an error message, saying it can't find the .class file for the applet.
In Tomcat I put my prjocet folder into "webapps" folder.
In the project folder I have the .jsp file and a fodler named after the package of the applet, and it contains the appletName.class and appletName.java files.

Here is the jsp code: (jsp:plugin tag) type="applet" code="appletName.class" codebase="packageName" jreversion="1.7" width="455" height="605" (jsp:plugin tag)

The fodler system:
../webapps/projectname/packageName/appletname.class appletname.java
../webapps/projectname/app.jsp

I was trying to make this thing work all night and no I'm tired, so if I wasn't clear at some point I'll explain it again.
Thanks for any help in forwards!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41865
    
  63
Remove the codebase attribute, and be sure to include the fully qualified class name (including the package name) in the code attribute.


Ping & DNS - my free Android networking tools app
Rudolf Hergat
Greenhorn

Joined: Jun 21, 2012
Posts: 6
Thank you very much! This problem is solved, but I bumped into another. Now the app is running, but not fully working. Some of the buttons doesn't react and the some labels aren't shown. I tryed it, and if I run it in NetBeans it's fully working.
Thanks for the answers in forward!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41865
    
  63
Are there any error messages in the Java Console?
Rudolf Hergat
Greenhorn

Joined: Jun 21, 2012
Posts: 6
No. This applet is a classic Mastermind game. The user have to guess the 4 colours that the computer "hide". The first screen tell the rules, and by clicking the start button the game starts. The first problem is, that the rules sometimes show sometimes don't and seems to be for no reason. The start button works every time. After clicking the start button the game starts and the game screen appears. There are 5 buttons on the bottom of the screen. The first four buttons are to chose colour, the fifth is an okay button, to send the guessed colours. The colour chosing buttons work fine, but when I press the okay button, nothing happens.

I know it's a long monologue, but I hope it gives a clear picture of my problem.
Rudolf Hergat
Greenhorn

Joined: Jun 21, 2012
Posts: 6
Now I did nothing, just refreshed the page (as I did several times before), and the applet runs perfectly now.
The problem is gone for now, even though I wouldn't call it a stable program.
Thank you for your time!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet as jsp plugin (Tomcat)