Bill Pearce

Ranch Hand
+ Follow
since Sep 19, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bill Pearce

Since someone mentioned Rod Johnson, you might be interested to know he has a new book coming out on doing J2EE without EJB. I attended TheServerSide Java Symposium, and Rod gave a presentation on J2EE programming without EJB (see some notes I made here).

Rod makes some very compelling arguments against EJB, especially when it comes to using them in Web applications. More specifically, he argues against distributed objects when we really don't need them. A lot of us need only certain services from J2EE, and there are more efficient ways to obtain them than through EJB.

I have only recently downloaded it and installed it, so I can't give too much testimony, but Rod was the initial creator of the Spring framework, a lightweight framework which seeks to provide some of what we need from EJB, without all the container overhead. Spring provides many things, but I have only set up the Inversion of Control method for obtaining DAO objects and setting the DataSource on the object rather than calling JNDI. I can tell you this has made the DAO/JDBC much easier to develop for my web application, as I can run it very quickly from the IDE, and don't have to redeploy the webapp, etc. to see results.
Hi all,
We have several applications which are web based and located at a co-lo facility, separated from our provate network by a firewall. The firewall protects the application servers from the internet and our private network from the application servers/internet. The problem we have faced (numerous times) is that any application which opens a stateful connection (whether JDBC to our internal database or a socket connection back to another server) is cut off from the machine it is connected to at strange times (resulting in "Conenction reset by peer").
I an fully aware that if traffic is not sent over the wire for a specified length of time, the firewall is expected to close the connection, but this is not during long periods of idle time.
My questions are: Has anyone faced similar issues with connecting through a firewall (ours is CheckPoint) to another resource (like a database) and maintaining that connection? If not, can anyone validate my theory that for the most part this is not the preferred way of doing things? Seems like what I have read would indicate that it's better to have the application server and database server on the same local network together. Anyone have any references on this I can use?
Any help appreciated.
Bill
I don't much care for client-side validation myself, but there are a couple of Jakrata projects that may be of interest to you. First check out the Jakarta Struts project. It includes an HTML tag library which you might be able to use. I don't know if client-side validation is supported, but it sure would beat starting from scratch.
The other is the Jakrata Taglibs project. Lots of useful tags to save you some work.
Bill
21 years ago
JSP
If you are asking where to place the actual class files, that should be in the WEB-INF/classes folder of your web application. Or you can place your classes in a JAR file and place the JAR in WEB-INF/lib. So you could have:
%TOMCAT_HOME%/webapps/myapp/WEB-INF/classes
and/or
%TOMCAT_HOME%/webapps/myapp/WEB-INF/lib
Hope that helps.
21 years ago
JSP
The Properties class makes this quite easy. Use this snipit when you want to place the properties file in the classpath. This can be a folder in your /WEB-INF/classes folder, or the common/classes folder off Tomcat root (assuming you are using Tomcat).

For the above, you would place the PropsFile.properties file in the

WEB-INF/classes/com/myname/test

folder.
21 years ago
JSP
Hope no one minds me taking another shot at this...
The TreeMap gets me close, but not all the way there. My requirements are these:
Reference elements by index (position in list, as with Vector).
Reference elements by key (as with Hashtable).
Move elements up or down in the list (as is possible creating your own Comparator and using Collections.sort(List, Comp)).
Sort list based on field of the elements in the list (like user.name or user.id, again possible with Comparator).
So it looks like I need to combine a couple of features of Map with a couple from List. I need an ordered list of elements that will let me reference elements by a key and allow me to handle the sorting of the list. Is this possible by subclassing one of the existing Java classes? If so, does anyone have a suggestion as to which?

Any help appreciated.
Bill
22 years ago
Hi all,
I am trying to implement a UserList class which should provide the caller with the following functions (among others):
Get a User by userId.
Get a User by index in the list.
Allow for sorting based on userId or name and move elements up and down in the list(using Comparator or something similar).
I am having trouble picking the best Class to act as the underlying Collection. Hashtable works for the first requirement, but not really well for the second and third (I tried using htable.values().toArray()[i] for the second requirement, but it seems a little awkward).
Vector handles the second two great, but I can't figure how best to reference by userId without looping through the whole list looking for the one I want.
I thought about maintaining a Vector and a separate index of userId's, but this seems risky.

Any suggestions?

Bill
22 years ago
Still looking for some input on this. Anyone?
22 years ago
Hi all,
I was wondering if it is possible to use something like the ZipInputStream/ZipOutputStream for communicating from applets to servlets. Would this result in a performace improvement at all? I thought I remember someone suggesting this once and was curious. If not, is there a better way to compress data sent back and forth?
Thanks as always,
Bill
22 years ago
Hi all,
I am currently working on an application in which a user periodically makes a request to the server to check a flag indicating whether an external event has occurrred. I would like to (when the event does occur) to grab the user's HttpSession and set a flag, so the servlet can simply check for the value there.
The deprecated HttpSessionContext Interface was good for this, as I could get a list of session id's and get a reference to the actual session I wanted. Now that is no more. Has anyone been successful in solving a similar problem? The SessionBindinglistener interface does not seem to give me what I need, as I need to get the session reference when an external event takes place.
Any thoughts appreciated.

Bill
22 years ago
Hi Manfred,
Thanks, but I am using MediaTracker, but the problem I have seems to be the sequence in which I am trying to do things. I need to :
Initialize the Panels on the Applet (which use the Images).
Call paint() on the Applet to display the "Please wait..." message.
Load the Images using MediaTracker.
Display the LoginPanel.
The problem is that I am initializing the Panels in the Applet's init() method. Since the Panels need the Images to construct themselves, I can't construct the Panels before the Images load.
Since the init() method must complete before paint() is called, I can't get the please wait message to display before loading the images.

Has anyone seen (or created) a multi-panel applet and used MediaTracker to load all the Images used on all panels at once? Every example I have seen uses only the Applet itself as the panel where the Images are displayed.

Thanks
Bill

22 years ago
Hi all,
I am writing an applet which includes several Panels placed on the Applet. I am facing some difficulty in formulating a method to track the loading of all the Images (on all the Panels), so that the main Applet does not start until all Images are available.
I can find no examples using anything like this. Has anyone tried to manage the loading of all the Images in a multi-Panel applet? Any ideas are appreciated as usual.
Bill
22 years ago
Hi all,
I am new to JMS and have a simple question (but can't find the answer). Can a non-j2ee server act as a JMS client? For instance, if I have several web applications running on multiple Tomcat servers, can they all act as JMS clients if there is a J2EE compliant JMS server handling the messages?
Thanks
Bill
Hi all,
So our product development team (marketing to you and me) has determined that a new phase of our web application should be served up as an applet. Because that's what the customers want. Right.
I am wondering about applet development given Microsoft's failure to include a JVM with XP. I wanted to outline the possible pitfalls and customer experience for our marketing people, but the research is tedious. Hoping to get some bottom line answers here. As I understand it:
New installs of XP (including those shipped on new PC's) will not have a JVM installed when they start up. The user can istall one on his own, and in fact will be promted to do so when first attempting to run an applet. Then they wait for the 5MB download.
Users upgrading from Windows NT or Windows 2000 will have their JVM (if present) carried over to the upgraded OS.
has anyone done any testing of your applets already under XP? If you have applets used by customers, are you supporting XP? Any issues?
I also saw (but can't find again) something about similar issues with Netscape 6+ users. Can anyone provide any details about this?
Any advice (other than not to use applets for Internet customers) is appreciated.
Bill
22 years ago
Hi all,
My company is planning the development of an applet for use by our customers, and there is a requirement for some table-like functionality that AWT just does not have. I might take a look at the Swing componenets, but am a little worried about forcing our customers to use Java1.2/Plugin, especially since we don not have control over their environment.
I was hoping to get some insight from some of you on the usability of the plugin in real-world customer use and how practical it might be.
Has anyone published an applet for external use that makes use of the plugin or Swing controls? If so, have there been any problems with supporting it? Any advice you can pass along will be welcome.

Bill
22 years ago