We are creating a web application whic primarily is driven through java/jsp (using Workshop 10.1). We have come over a problem which requires us to introduce an applet to the stack.
Our application configuration concists of a dynamic web project (main project) and a utility J2EE project (the applet). The Applet currently concists of just one java class, and if we could, we would happily incorporate this into our main project. But I hear that to run the applet it has to be inside a containing jar and that requires us to use a separate project.
* If we configure our main projects J2EE Module dependency to point to the applets project, we seemingly get no results.
* If we add the utility project to the main project's build path, we get an error message during deployment: "The web project build path contains classes or jars which are not inside the standard <WebApproot>/WEB-INF/classes or <WebApproot>/WEB-INF/lib directories"
We want the applet to be available to the client. The "/WEB-INF/lib/" and "/WEB-INF/classes" aren't, and we can therefore not export the utility project manually as a jar to these folders.
The best solution would be to create a dependancy which would compile and deploy our utility project as a jar or classes automatically when we build our main project, and place the file(s) in a location available to the client. But I do not know how we could do this.
Anyone want to share some knowledge on this issue? It would be greatly appreciated.
* On which path in the main project does the jar file have to be placed in order for it to be available to the client?
* How do we deploy the jar through the Workshop IDE? Do we have to use ANT scripting to acheive this?
You can also checkout the link http://e-docs.bea.com/wls/docs100/webapp/configureresources.html#wp158951
If you need to serve classes or other resources from the system CLASSPATH, or from the WEB-INF/classes directory of a Web application, you can use a special servlet called the ClasspathServlet. The ClasspathServlet is useful for applications that use applets or RMI clients and require access to server-side classes.
The ClasspathServlet returns the classes or resources from the system CLASSPATH in the following order:
jar files under WEB-INF/lib/*
So may be you can place your applet in one of the places and serve it using classpath servlet from wls. I haven't tested this servlet with workshop but I will check it out.