Chris Lamey

Greenhorn
+ Follow
since Nov 14, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Chris Lamey

Hello all,
First off, I'm building a Swing app using the 1.4.1 JDK. The app has tabbed panes where each pane has complicated JPanels (containing more tabbed panes, tree views, and tables) where events in one pane need to be propagated to objects in other panes. The objects intending to generate and listen to the events are created by their immediate containers which are far down the hierarchy in the panes. Currently they don't have direct references to objects in other panels. Our current quick and dirty answer is to use getParent() in the event handler to go up the chain to a common parent container and then make a straight call that propagates down to the listening component. But I don't like that because it relies on the hierarchy staying static, which I'm not sure is true and seeing things like getParent().getParent().getParent().getParent() triggers a red flag. Other ideas include a application wide 'uber-event' handler that everything uses, a more specific dispatcher-type-object that gets passed around and handles the events, and some other ideas. Does anyone out there have a good example of or guidelines on how to manage this sort of thing? How do other people deal with event handling in complicated applications?
Secondly, in this application we need to put various cominations of JLabels and JTextFields, JLists, etc into a single object reference. The idea is that we need to be able to take any one of our system's business object attributes which are of various types (text, datetimes, addresses, enumerated distances, multi-valued text, currency ranges, etc) and present them in the UI. Our current thinking is to extend JPanel and have each child know how to take a specific type of attribute and put whatever it needs to visually represent the attribute onto itself. A factory would then be able to take an attribute and return a JPanel that could be drawn pretty much anywhere in the application. Does that seem like a decent idea or is there another container/component besides JPanel that we should consider? Or is there an altogether different strategy that might be better?
Any thoughts are appreciated.
Thanks,
Chris
21 years ago
Most likely you're going to have to add an include into every existing file.
You might be able to add the navigation bar using HTML frames. You could create a frame for the bar and then put all of your existing content in another frame.
I'm not sure if this is feasible with your application. My sense is that it'd be much easier to add include statements in the existing files...
21 years ago
JSP
Well, the JSP v1.1 spec says that jsp:foward only takes relative URLs, so I'm surprised a full URL works for you using jsp:forward (doesn't in my servlet container).
But anyway, check out the generated .java file from your .jsp that does the forward. See how your jsp:forwards are rewritten as a servlet.
BTW, this code:

Works for my Netscape 4.77 Win32.
21 years ago
JSP