CJAN is the Comprehensive JavaTM Archive Network, a peer-to-peer mirror network of Java code, documentation and tools.
Category Archives: J2EE
A general-purpose Java SOAP client
I got really stuck working with some ASP code that is connecting to an ASP.NET webservice, nothing helps more than being able to see what is being returned (or not being returned in my case). This simple SOAP client on ibm developerWorks came in handy, the code is available to download.
Articles from JDJ
Couple good articles in JDJ this month:
JavaServer Faces: “Developing interesting and effective Java Web applications requires simple, robust, and manageable frameworks and the tools that complement them.” — I read the article and tried to keep up… JSF is NOT simple.
Design Patterns: Java Value Types: “They’re used to transport and adapt an entity’s state between components of a system or to and from other formats, such as XML.”
Convenience Apps: “What is a killer app for J2ME?“: If he knew, he wouldn’t be writing for a magazine. 🙂
How to Make J2EE Perform Well
The May New Englang Java Users group presentation on Struts is online. Next month they’re having Owen Taylor from The Middleware Company present “How to Make J2EE Perform Well“.
Server-Side Flash Detection Using BrowserHawk @ DEVNET
I wrote an article for Macromedia Devnet which was just published today! Check it out here: Server-Side Flash Detection Using BrowserHawk. If you’ve never used BrowserHawk before, it’ll be a good introduction. However, if you’ve used it with ColdFusion, you should definitely read it, I was able to use BrowserHawk 4J (the Java version) with CFMX rather than using the ASP bridge (which was and is required if you want to access the extended properties of BrowserHawk in versions of ColdFusion prior to MX).
I should thank Shena at my work for bringing it up as an option (she contacted Macromedia originally), thanks Shena!
Open source Java components
JavaIndex.org is a comprehensive list of open source Java components.
apache xml-rpc metaWeblog api
Some irish guy wrote up a short blogging APIs mini how-to yesterday. Then some other guy from England (I think) commented that he had written up a quick example of using the apache xml-rpc package to call the metaWeblog api. So I had to try it too. Turns out that a) xml-rpc is really easy to do and b) the Moveable Type xml-rpc api is really easy too… the code below calls the getRecentPosts() method of the metaWeblog api using the apache xml-rpc package:
import org.apache.xmlrpc.*;
import java.util.*;
public class MTTest {
public static void main(String[] args) throws Exception {
System.out.println(“Starting Movable type stuff”);
Vector params=null;
// Create XML RPC Client object
XmlRpcClient xmlrpc = new XmlRpcClient(“http://yourhost.com/MT-2.21/mt-xmlrpc.cgi”);
// blogger.getRecentPosts
// String appkey, String blogid, String username, String password, int numberOfPosts
System.out.println(“Adding the parameters”);
params = new Vector();
params.add(“your_weblog_id”); // weblog id
params.add(“yourusername”); // username
params.add(“yourpassword”); // password
params.add(“4”); // number of posts to retrieve…
System.out.println(“Making the call”);
Vector v = (Vector)xmlrpc.execute(“metaWeblog.getRecentPosts”,params);
System.out.println(“This call results in ” + v.size() + ” posts.”);
System.out.println(“These are the results:”);
for (int i=0; i
Overriding the equals() method
I was looking for any best practices related to overriding the equals() method in objects and came across javapractices.com, which has a section devoted to the equals() method: Implementing equals. This article doesn’t really answer the question of “when” you override the method, although from other reading I can surmise that you do so whenever you think you or someone else may need to use the object as a key in a hashtable. Any other opinions as to the “when” of overriding the equals() method?
Core Servlets & JSP Book
On the subject of free books, Marty Hall’s book Core Servlets & JSP is available for free as well, you can download the PDF here.
Requesting a URL securely
We had a thread going at work about finding out if the user is requesting a URL securely, ie: using HTTPS. Various methods were thrown about: getScheme(), getProtocol(), getServerPort()… We missed the most obvious one: isSecure()