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

Applet Code Management

Mark Binau
Ranch Hand

Joined: Mar 04, 2004
Posts: 37
I have two questions about how to best handle applets. I am developing in WSAD5 (Eclipse 2) and planning to run my applications in WebSphere 5.
1. Where should I maintain the applet source code? If the source code is included in the web project with the servlet source code it will compile to the webApplication/WEB-INF/classes directory and I must either move or copy it to the webApplication/classes so it can be used by the client. Is there some other way to elegantly change the location of where the code is compiled? The build output folder only seems to allow a single location per project and it can only be in the same project.
2. Is there an elegant way to automatically recreate the applet jar files when the source code changes? I know how to use the jar packager but it requires me to manually update the jar. I am hoping for a utility to automatically build the jar(s) anytime the applet source code changes. I have looked at the zip creation utility by Tim DeBoer and it works great for a utility project but does not allow me to cherry pick specific classes to include in the jar so that size of the applet jar is minimized.

Thanks,
Mark
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

There's a little checkbox down at the lower left. Click it to enable different source directories to build into build directories of their choice.
You can also make a separate project for the applet, have it produce a jar (recommended), mark the webapp project as being dependent on the applet project and reference the applet jar as an external jar. As far as project-to-project copying goes, I think you may need to put that in an Ant script. The alternative would be to demote the applet and webapp sub-projects to be separate directory branches or play similar directory games.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mark Binau
Ranch Hand

Joined: Mar 04, 2004
Posts: 37
Tim, thanks for the quick response. I don't see the "little checkbox down at the lower left". I am selecting the web project in Navigator view and choosing properties. From there I select Java Build Path. The Source tab is where I can create additional source folders. Underneath the tabs is where the Build Output Folder location is specified. Where in this do you see the littel checkbox? Or are you talking about some place else completely?
Below is my version from the Help/About:
WebSphere Studio Application Developer (Windows)
Version: 5.0.0
Build id: 20021125_2118
Thanks,
Mark
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
Use Ant and it will solve all of your problems (Seriously). I haev a project that has servlets/JSPs, static stuff (like HTML and images) and an applet and Ant does all the build work for me.
brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
Mark Binau
Ranch Hand

Joined: Mar 04, 2004
Posts: 37
Thanks Brian. I'm in the process of learning Ant now.
 
jQuery in Action, 2nd edition
 
subject: Applet Code Management