aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Java Applets as Application Clients Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Java Applets as Application Clients" Watch "Java Applets as Application Clients" New topic
Author

Java Applets as Application Clients

Joshua Doerring
Greenhorn

Joined: Aug 08, 2003
Posts: 19
Recently we got a new webserver "WebSphere Application Server 5.0"
it's EJB compliant so our code must go into EAR files and WAR files, etc. I got the WAR file stuff all figured out and I've been able to hit my servlets.
The problem is that our clients are all applets. Where does the applet's jar file go?
I've read the blue prints and EJB Clients "Application Clients" can be Applets. But it doesnt say where the classes.
I tried putting the jar file in the ear file at the same level of the war. but i wasn't able to access the jar file from the web. i had every thing setup like this.
test.ear
--META-INF
----application.xml
----ibm-application-ext.xmi
----MANIFEST.MF
--testserver.war
----META-INF
------MANIFEST.MF
------WEB-INF
--------classes
----------TestServlet.class
--------ibm-web-bnd.xmi
--------ibm-web-ext.xmi
--------web.xml
------AppletPage.html
--testclient.jar
----META-INF
------MANIFEST.MF
----TestApplet.class
This was constructed with "IBM WebSphere Application Developer 5.0"
I put a test response in the doGet method of the servlet and I can hit it but the html couldn't find the applet jar file. I ran the applet in appletviewer and it worked but I don't want the end user to have to do that.
My EAR Deployment descriptor looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
<application id="Application_ID">
<display-name>Test</display-name>
<module id="WebModule_1060004907688">
<web>
<web-uri>testserver.war</web-uri>
<context-root>/test</context-root>
</web>
</module>
<module>
<java>testclient.jar</java>
</module>
</application>
My web deployment descriptior looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp">
<display-name>TestServer</display-name>
<servlet>
<servlet-name>TestServlet</servlet-name>
<display-name>TestServlet</display-name>
<servlet-class>TestServlet</servlet-class>
<load-on-startup>-1</load-on-startup>
</servlet>
</web-app>
I type http://<ip-address>/test/AppletPage.html to test the applet.
My codebase is this: codebase="."
My archive is this: archive="testclient.jar"
I get a ClassNotFoundException on the applet.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The applet .jar file needs to be accessible via a URL so you need to put it into one of the .war files (or make a dedicated applet.war).


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Joshua Doerring
Greenhorn

Joined: Aug 08, 2003
Posts: 19
Putting the applet.jar file into the war worked out greak. Thanks for the help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Applets as Application Clients