Amund Frislie

Greenhorn
+ Follow
since Jan 25, 2002
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 Amund Frislie

(Hope this is the correct address for this question).
I'm collecting parameters from a form (using Struts on Tomcat) to build a URL. The problem appears when special chars like '�', '�', '�', etc. are sent with the URL. I use DOMParser's parse method to retrieve an XML document from a server (connecting using the mentioned URL). Does anyone have a nice solution to this (apart from scanning the whole URL string and replace special chars)?
Thank you.
Amund
21 years ago
Could someone please advise me as how to best implement (in Struts) a form which spans multiple pages (and requests)? It will consist of app. 3 pages, where after page 1 is filled out the user clicks on "Next" and is directed to page 2, etc. Thank you.
regards,
Amund
21 years ago
Does anyone know where I can find weblogic's DDInit tool? Does it ship with WL6.0? Is it commercial?
Cheers,
Amund
21 years ago
Just got my results from Sun. Thanks, everyone, I know I received a lot more from this site than what I contributed.
The breakdown:
General Considerations(maximum = 58): 58 Documentation(maximum = 20): 20 GUI(maximum = 24): 24 Server(maximum = 53): 49
(Created a separate interface for the server which I didn't use on the client or data side. That's one thing. Ah, well...)
cheers.
Amund
"Quid quid latine dictum sit, altum viditur"
21 years ago
Let's imagine: IF you were to upload your assignment, book exam and all that today. Then, after looking at some other people's solutions, you start to question parts of your own. In fact, you are quite conviced about some of the weaknesses of your application, you can even pinpoint them rather directly.
Let's then make a little time travel into the examining room, where there are some (horrible) questions about your design popping up... Would you...
a) Defend your decisions, even though you know you could have made it different and even better? Or...
b) Describe your design's weaknesses and how they could have been done better?
...of course this has nothing to do with yours truly having uploaded the assignment today...

regards
Amund
In general, whenever modifying the db file one should follow the sequence mentioned. Why would you give the user permission to change the flight information, apart from 'available seats' (and even this should be changed automatically)?
Cheers,
Amund
�The remote client code that you write must provide all the public methods of the suncertify.db.Data class�. Why do you think Sun has made this requirement? Does this imply that any "larger" methods containing multiple Data methods (e.g. booking) should be on the client side only? Would lead to a lot of network chatting...
Amund
Thank you all.


Sai: Also, you could use the remote implementation object as the key to the HashTable instead of having a seperate clientId.


Do you mean using Thread.currentThread().getName()? I tried this, and it works. The function returns a string of this format: "RMI TCP Connection(9)-10.10.53.80", where the number within the brackets (9) differs if there are multiple clients on the same computer. Could I rely on this being unique every time? It would save me generating userId's.


Peter: Arguably your lock() method has a bug, it really should ignore attempts to lock the same record twice.


Why? If a client tries to lock a record that's already in the the map, it means that it's "taken" and the client should wait untill it's released. I do however check whether the same client already has a lock on the record, but omitted it for clearity...


your problem might be that you're calling LockManager from within synchronized methods in Data, and your lockMap.wait() only releases the monitor lock held on lockMap, not the one on Data. You must either call LockManager from a non-synchronized Data method, or synchronize everything on Data.


Hooray, found it! I had ehem... for unknown reasons synchronized the lock and unlock methods in the server class.

Rene: the lockMap.get(recordInt) returns the value (a string in this case) pointed to by the key, not the key.
Appreciate all your contributions. Well, back to testing. Thanks.
Cheers,
Amund
Hi.
I've implemented my lock/unlock methods according to "the book", or at least, that's what I thought untill starting the testing... Here's what I have (excluding some checking of valid record number):

It fails the following testing: I create 2 clients, accessing the same dataserver (using RMI). Client 1 locks a record (works fine). Client 2 tries to lock the same record and ends up at lockMap.wait(). Client 1 tries to unlock the record and it "crashes". I can see client 1 calling the lock method in the class which connects to the server, but there it stops (i.e. I can not see control is transferred to the server). All these steps are done manually (i.e. I handle all locking/unlocking explicitly). I use a LockManager (singleton) to handle the locking. The LockManager is accessed via the Data class (should this also be a Singleton?). Appreciate any inputs on this. Thanks.
Amund
p.s: I decided to start a new thread on this, although it is a continuation of what's found at:
https://coderanch.com/t/180191/java-developer-SCJD/certification/record-lock-unlock - this is getting rather long, though.
[ April 16, 2002: Message edited by: Amund Frislie ]
Good idea. It works now. Thanks Mathew.
I have build up my gui using gridbag layout. On the top row, there are 3 panels (search, message and booking). On the row below, spanning all columns, there's a JScrollPane. Problem is, if the scroll pane is filled and the message panel is updated with some new text, this makes the whole scroll pane collapse. I've tried to put the scroll pane inside another JPanel, but without success. Anyone experienced this? Any suggestions on how to aviod it?
Thanks.
Amund
Strictly speaking, the DNS name is the name of the server only (e.g. 'localhost'). In my application I only ask for the DNS name and then use that argument to build the lookup string (together with port number if given). Taking your example, I'm sure there's no problem in hardcoding, like the following:
"rmi://" + dnsName + "/serviceFactory"
Shouldn't be a problem as long as your interface declares the db.Data methods.
(Your ConnectionFactory should only provide instances of "connection classes" anyway...)
Amund
[ February 26, 2002: Message edited by: Amund Frislie ]
[ February 26, 2002: Message edited by: Amund Frislie ]
Thank you, Mark.
Would it be an idea to split the client mvc design into two: one for the actual client and another for the table (contained within the client ui)? Or is that an overkill? There seems to be a some table-specific logic I'm not sure what to do with...
The dilemma: keeping the two methods createTable() and updateTable() in the View, goes against the principle of keeping it "view only" (no logic). However, by putting these methods into the Controller, would mean that the View would have to access the Controller, not only the other way around. This would also go against the mvc pattern, wouldn't it?
Any opinion on this, anyone?
Thank you.
Amund
[ February 21, 2002: Message edited by: Amund Frislie ]
Hi.
I'm a bit stuck on my client-side design and would be extremely grateful if someone could help me out.
Here's what I have: a connection interface (providing all public db.Data methods) that is implemented by two classes, remote and local (connect to a server and a data layer respectively). A client facade, containing the methods 'getConnection', 'search' and 'book'. A client gui class that creates all swing components, implements listeners, handles events, etc.
From what I've read in earlier articles here at the ranch, one should use mvc to implement the gui. Does this mean just using swing components that already use mvc (jtable, etc.) or actually implement the mvc pattern to your whole client gui? If the latter: how would you do this? My current class, I can see, is now far too big and should be broken up. Is it a good idea to create a separate controller class to handle events? I suspect this alone would not make it a mvc pattern...
Final question: Is there any point in introducing a ConnectionFactory when I've designed like described above?
Definitely last question: I'm not too familiar with patters. Is my ClientFacade a facade or a proxy...?
Appreciate any comments.
Cheers.
Amund