comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* SSO in WebApplication, Help - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7d0840b238451d82
* Iteration over sets - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2464f0c85c8b717f
* Is Java good for writing simple, yet sleek GUI apps? - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/597623eb2cda9cc3
* Good idea or full of it? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ceda7465055571c
* code hangs when reading from socket - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8990f56bd2a4bba0
* test - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fc4993abbc510d4
* Need help w. getOutputStream( ) - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57fcce963c42a641
* Benchmarking embedded Java - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6374a6706030c71b
* Need good free beautifier other than Jalopy - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b4415996c299a7af
* Light Servlet Container - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a1f451cb3bd91b1
* Extension problem Mac OS X (launching of external jar doesn't work) - 1 messages, 1 
author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3dd4b342d0c112d6
* what sample work to show in job interview? - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f7668b32a1da179
* Question about EJB's - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d4a780fe530c2ba
* BOOK: Enterprise SOA - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fe965eb1b2cfafa
* Start a windows program - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1b169b5fb0ad711e
* Why does this work for Canvas but not for JPanel? - 4 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/42cf2394a0e56b78
* Difference between <jsp:useBean> and <bean:define> ? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ada2085c54b155b
* How to replace all TABS in a currently opened java source file to BLANKS 
(Eclipse/Websphere) - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/10428b4c71e4ee15
* writeObject and readObject problem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e6fc9480a3a7f42a
* Garbage collector question - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/793ab88313c687f9
* I got the Herbert Schilt, (Java 2) Package blues. Please help before I shoot the dog 
- 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f29e821306447a70
* Java trick - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfd25be52dc6a3ad
  
==========================================================================
TOPIC: SSO in WebApplication, Help
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7d0840b238451d82
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 1:20 am
From: Rick Z <[EMAIL PROTECTED]> 

Hi!

I have to design and implement SSO(single sing-on) to webapplications
(servlet and jsp based) and I should also use JAAS or other standard API.

Does anyone know any sample application and/or documentation that could 
show me how JAAS should be used in webapplicatations?

Thanks,

rz






==========================================================================
TOPIC: Iteration over sets
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2464f0c85c8b717f
==========================================================================

== 1 of 2 ==
Date:   Sat,   Sep 25 2004 1:56 am
From: "Filip Larsen" <[EMAIL PROTECTED]> 

Swarat Chaudhuri wrote

> I have a set S over which I would like to iterate. While iterating, in
> certain cases, I want to add elements to the set. I would like the
> iterator to treat these new elements as if they have not been seen so
> far.  However, doing so seems to guarantee that concurrent
modification
> exception will be thrown.
>
> So the question is, is there a way to achieve what I want to do?
Without
> needing to restart the iteration every time an "update" occurs?

I see two fairly common ways of doing it:

- Iterate over a list copy of S and add directly to S, or
- Iterate over S and add to a list, then when iteration is done add the
list to S and (optionally, depending what your algorithm is doing)
iterate S (or the list) again if list was non-empty.

The first way is good if S is fairly small and you expect a lot of
modifications to the set. The second is good in all other cases even
though it is slightly more complex to implement. The following method
should show an example of it could be done (the processElement method
returns a collection of new elements that needs to be added to the se):

public void processSet(Set s) {
 Iterator i = s.iterator();
 while (i.hasNext()) {
  Collection adds = new LinkedList();
  while (i.hasNext()) {
    adds.addAll(processElement(i.next()));
  }
  s.addAll(adds);
  i = adds.iterator();
 }
}


Regards,
-- 
Filip Larsen





== 2 of 2 ==
Date:   Sat,   Sep 25 2004 7:02 am
From: "Thomas G. Marshall" <[EMAIL PROTECTED]> 

Filip Larsen coughed up:
> Swarat Chaudhuri wrote
>
>> I have a set S over which I would like to iterate. While iterating,
>> in certain cases, I want to add elements to the set. I would like the
>> iterator to treat these new elements as if they have not been seen so
>> far.  However, doing so seems to guarantee that concurrent
>> modification exception will be thrown.
>>
>> So the question is, is there a way to achieve what I want to do?
>> Without needing to restart the iteration every time an "update"
>> occurs?
>
> I see two fairly common ways of doing it:
>
> - Iterate over a list copy of S and add directly to S, or
> - Iterate over S and add to a list,

This approach would only require a second set, not a list, AFAICT.  IMBW.



> then when iteration is done add
> the list to S and (optionally, depending what your algorithm is doing)
> iterate S (or the list) again if list was non-empty.
>
> The first way is good if S is fairly small and you expect a lot of
> modifications to the set. The second is good in all other cases even
> though it is slightly more complex to implement. The following method
> should show an example of it could be done (the processElement method
> returns a collection of new elements that needs to be added to the
> se):
>
> public void processSet(Set s) {
>  Iterator i = s.iterator();
>  while (i.hasNext()) {
>   Collection adds = new LinkedList();
>   while (i.hasNext()) {
>     adds.addAll(processElement(i.next()));
>   }
>   s.addAll(adds);
>   i = adds.iterator();
>  }
> }
>
>
> Regards,

-- 
Onedoctortoanother:"Ifthisismyrectalthermometer,wherethehell'smypen???"







==========================================================================
TOPIC: Is Java good for writing simple, yet sleek GUI apps?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/597623eb2cda9cc3
==========================================================================

== 1 of 3 ==
Date:   Sat,   Sep 25 2004 2:09 am
From: Joona I Palaste <[EMAIL PROTECTED]> 

Andrew Thompson <[EMAIL PROTECTED]> scribbled the following:
> On Wed, 08 Sep 2004 21:25:20 GMT, Thomas G. Marshall wrote:
>> Heck, I was born into the English language, and I'm about as bad as they get
>> :)...

> ;-)  I was almost going to mention earlier, 
> that I get help from a lot of people with 
> 'foreign sounding' names, and assume they 
> grew up in America or Britain because
> they can correct my grammar, ..only to 
> discover later that they had never as 
> much as visited either country.

Because of my good knowledge of written English, I've been thought as a
British woman living in Finland. I've responded by telling that I'm
neither British nor a woman.

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I am looking for myself. Have you seen me somewhere?"
   - Anon



== 2 of 3 ==
Date:   Sat,   Sep 25 2004 5:12 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 25 Sep 2004 09:09:14 GMT, Joona I Palaste wrote:

> Because of my good knowledge of written English, I've been thought as a
> British woman living in Finland. 

I get mistaken for British by most other Aussies!

> I've responded by telling that I'm
> neither British nor a woman.

What do you mean by, '..nor a woman'?  


;-)

-- 
Ms. Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane



== 3 of 3 ==
Date:   Sat,   Sep 25 2004 5:15 am
From: "Michael Saunby" <[EMAIL PROTECTED]> 


"Joona I Palaste" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Andrew Thompson <[EMAIL PROTECTED]> scribbled the following:
> > On Wed, 08 Sep 2004 21:25:20 GMT, Thomas G. Marshall wrote:
> >> Heck, I was born into the English language, and I'm about as bad as
they get
> >> :)...
>
> > ;-)  I was almost going to mention earlier,
> > that I get help from a lot of people with
> > 'foreign sounding' names, and assume they
> > grew up in America or Britain because
> > they can correct my grammar, ..only to
> > discover later that they had never as
> > much as visited either country.
>
> Because of my good knowledge of written English, I've been thought as a
> British woman living in Finland. I've responded by telling that I'm
> neither British nor a woman.
>

Ah but coding's different, it's more like poetry than prose and modern
English (language) poetry comes from all corners of the globe.  Some can be
rather hard to understand, but the better stuff (both code and poetry) has
patterns to it that tend to make me smile.

e.g.
http://notjustbeerandpubs.com/tomleonard/access_to_the_silence/100_differences.shtml

or even,  http://www.yclusa.org/article/articleview/1570/1/294

Michael Saunby






==========================================================================
TOPIC: Good idea or full of it?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ceda7465055571c
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 2:36 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

Chris Uppal wrote:
> Abrasive Sponge wrote:
> 
> 
>>public static int getCount() {
>>return static.count; //using a static keyword as such
>>}
>>}
> 
> 
> Personally, I rather like this idea.
> 
> I've speculated for a long time that Java could use a "thisClass" notation of
> some kind.  It would eliminate a large chunk of completely pointless verbosity.
> 
> However I think that an explicit "thisClass" notation would probably work
> better, in the sense that it could be used in more circumstances without
> confusion.
> 
> For instance, consider a typical Singleton implementation:
> 
>     class MyClass
>     {
>         private static final MyClass singleton = new MyClass();
> 
>         public static MyClass
>         getSingleton()
>         {
>             return MyClass.singleton;
>         }
>     }
> 
> using "thisClass" in the above code would eliminate a great deal of redundancy:


What is wrong with writing:

          getSingleton()
          {
              return singleton;
          }

even less verbosity!
alex




==========================================================================
TOPIC: code hangs when reading from socket
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8990f56bd2a4bba0
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 3:16 am
From: Gordon Beaton <[EMAIL PROTECTED]> 

On 24 Sep 2004 22:35:19 -0700, Jani Yusef wrote:
> I am attempting to send data to a client socket and then turn around
> and read the response back from the client. The data is sent but when
> I attempt to read the data sent back it hangs. I have checked and the
> client is receiving the data just fine and seemingly sending back a
> perfectly correct reponse. Is there an error in the code below which
> is preventing me from reading the data sent back to me correctly?
> Any advice would be much appreciated.
> 
> //servo is an instance of ServerSocket and socko is an instance of
> Socket
> 
> //send the message to attached clients
> Socket s=servo.accept();
> PrintStream ps=new PrintStream(s.getOutputStream());
> ps.println(response);
>                         
> //Now read the response from the clients
> s=servo.accept();//read input from clients
> br=new BufferedReader(new InputStreamReader(s.getInputStream()));
> response=br.readLine();//STUCK HERE, THE NEXT LINE IS NOT REACHED

The fact that you call accept() after sending the text seems to
indicate that you expect to receive it back from a *different* client
(or at least on a new connection). Is that the case? Does the client
really read the data from the server, then connect again?

How does the client send the response? Does it send a line of text
(i.e. that ends with a newline)?

Why don't you show us a complete, compilable example that includes
both sides of the connection.

/gordon

-- 
[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e




==========================================================================
TOPIC: test
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fc4993abbc510d4
==========================================================================

== 1 of 2 ==
Date:   Sat,   Sep 25 2004 3:13 am
From: "EIM News" <[EMAIL PROTECTED]> 

test 





== 2 of 2 ==
Date:   Sat,   Sep 25 2004 4:54 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Sat, 25 Sep 2004 14:13:03 +0400, EIM News wrote:

> test

alt.test.* is -> thataway.  Please use it for future tests.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane




==========================================================================
TOPIC: Need help w. getOutputStream( )
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57fcce963c42a641
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 3:20 am
From: Gordon Beaton <[EMAIL PROTECTED]> 

On Sat, 25 Sep 2004 05:41:18 GMT, Steve Burrus wrote:
> I need some pretty immediate help w. using the getOutputStream()
> servlet method to be able to see an image in my web browser!! Can
> anyone possibly help me with this please???

I don't know what kind of a response you were hoping for, but it
usually helps if you actually ask a question. If someone can help,
they will.

/gordon

-- 
[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e




==========================================================================
TOPIC: Benchmarking embedded Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6374a6706030c71b
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 3:48 am
From: "Martin Schoeberl" <[EMAIL PROTECTED]> 

Thank's to Tim Simpson results for a TINI at 40MHz is added to the list.

Martin
--
----------------------------------------------
JOP - a Java Processor core for FPGAs:
http://www.jopdesign.com/

"Martin Schoeberl" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> As I'm working an a Java processor I'm interested to benchmark embedded
> Java systems. However, the usual SPECJvm98 is far too large for many
> embedded system.
> After searching around on the net to find embeddded benchmarks in Java
> I've decided to write a new benchmark suit.
>
> It contains several micro-benchmarks to evaluate CPI for single
bytecodes
> or short sequences of bytecodes, one synthetic benchmark (the Sieve of
> Eratosthenes) and two application benchmarks.
>
> To provide a realistic workload for embedded systems a real-time
> application was adapted to create the first application benchmark
(Kfl).
> The application is from one node of a distributed motor control system.
A
> simulation of the environment (sensors and actors) and the
communication
> system (commands from the master station) forms part of the benchmark
for
> simulating the real-world workload.
>
> The second application benchmark is an adaption of a tiny TCP/IP stack
> (Ejip) for embedded Java. The benchmark contains two UDP server/clients
> exchanging messages via a loopback device.
>
> There is a great variation in processing power on different embedded
> systems. To handle these variation all benchmarks are `self adjusting'.
> Each benchmarks consists of an aspect that is benchmarked in a loop and
> an `overhead' loop that contains any overhead from the benchmark that
> should be subtracted from the result (this feature is for the micro
> benchmarks). The loop count adapts until the benchmark runs for more
than
> a second. The number of iterations per second is calculated which means
> that higher values indicate better performance.
>
> The benchmark framework needs only two system functions: One to measure
> time in millisecond resolution and one to print the results.  These
> functions are encapsulated in LowLevel.java and can be adapted to
> environments where the full Java library is not available. For example,
> the leJOS system has very limited output capabilities and and a special
> LowLevel.java exists in the lejos subdirectory. The benchmark is
> straight-forward to use. To compile and run all benchmarks on a
standard
> JVM simple type:
>
>         javac jbe/DoAll.java
>         java jbe.DoAll
>
> I've put the results of JOP, leJOS, JStamp (aJ80), EJC and, for a
> reference only, different JVM versions (Suns JVM and gcj) running on a
> Pentium MMX 266 at my website:
>
> http://www.jopdesign.com/perf.jsp
>
> If someone has access to other embedded Java solutions it would be nice
> to add benchmark results to the table. You can find the source of the
> embedded benchmark at the website above.
>
> I would be especially interested in following platforms: the aJ100,
TINI,
> Cjip, Lightfood in an FPGA, Moon and the PSC1000 (now called Ignite).
>
> Martin
> ----------------------------------------------
> JOP - a Java Processor core for FPGAs:
> http://www.jopdesign.com/
>
>
>






==========================================================================
TOPIC: Need good free beautifier other than Jalopy
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b4415996c299a7af
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 4:12 am
From: jungi <[EMAIL PROTECTED]> 

Tivo Escobar wrote:
> Hi all,
> 
> anybody could recommend a good free java beautifier (code formatter,
> pretty printer, etc.) other than Jalopy?
> 
> I am about to run a beautifier over a 150,000 lines app and Jalopy
> comes with a bizarre 'feature' that is really frustrating: it is
> indenting my anonymous inner classes with an extra 'tab' (4 spaces).
> 
> Thanks in advance,
> 
> Tivo Escobar

http://beautyj.berlios.de/

--jungi




==========================================================================
TOPIC: Light Servlet Container
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a1f451cb3bd91b1
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 4:16 am
From: jungi <[EMAIL PROTECTED]> 

Genawa wrote:
> Hello Everybody,
> 
> I have been looking around for a very light weight servlet container.
> Both Jetty and Tomcat are 8MB-10MB distributions before install and
> takes almost 15MB of RAM. I found winstone
> (http://winstone.sourceforge.net/) which is only a 139K download, very
> light weight and what I am looking for but only an ALPHA release.
> 
> Is there anything else out there that's similar?
> 
> 
> 
> Genawa

http://go.to/bajie

--jungi




==========================================================================
TOPIC: Extension problem Mac OS X (launching of external jar doesn't work)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3dd4b342d0c112d6
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 4:29 am
From: Jonck <[EMAIL PROTECTED]> 

> The "MainApp" is able to show System Properties and I can see the
> following (only the most important):
> sun.boot.library.path =
> /System/Library/Frameworks/JavaVM.frameworks/Versions/1.3.1/Libraries
> java.class.path = MainApp.jar:/Applications/MainApp/Contents/Resources/
> Java/lax.jar java.home = /System/Library/Frameworks/JavaVM.frameworks/
> Versions/1.3.1/Home java.ext.dirs = /Library/Java/Extensions:/System/
> Library/Java/Extensions:/System/Library/Frameworks/JavaVM.frameworks/
> Versions/1.3.1/Home/lib/ext

Ok, since you are getting a NoSuchMethodException could it be that the 
method that is causing this exception is implemented only in Java 
versions >1.3.1? Which version of Java are you using on your M$ and 
Linux machines?




==========================================================================
TOPIC: what sample work to show in job interview?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f7668b32a1da179
==========================================================================

== 1 of 3 ==
Date:   Sat,   Sep 25 2004 4:57 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 24 Sep 2004 23:00:09 -0700, Matt wrote:

> For a job interview, what sample work we should show? 

Why don't you show them transcripts of some of the 
many times you have helped people learning Java through
the public discussion groups?

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane



== 2 of 3 ==
Date:   Sat,   Sep 25 2004 5:51 am
From: "Michael Saunby" <[EMAIL PROTECTED]> 


"Andrew Thompson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 24 Sep 2004 23:00:09 -0700, Matt wrote:
>
> > For a job interview, what sample work we should show?
>
> Why don't you show them transcripts of some of the
> many times you have helped people learning Java through
> the public discussion groups?
>

Wicked :-)

Is in common (in the USA ?) to ask job applicants to provide examples of
work done in past employment?  In the UK I reckon you're more likely to be
asked to describe projects and answer more general questions.  How would
you even know that the work was really their own?

Maybe if coding skills are really crucial it might be better to set a few
problems and leave them at a PC for an hour or two.

Michael Saunby





== 3 of 3 ==
Date:   Sat,   Sep 25 2004 6:57 am
From: "Thomas G. Marshall" <[EMAIL PROTECTED]> 

Michael Saunby coughed up:
> "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On 24 Sep 2004 23:00:09 -0700, Matt wrote:
>>
>>> For a job interview, what sample work we should show?
>>
>> Why don't you show them transcripts of some of the
>> many times you have helped people learning Java through
>> the public discussion groups?
>>
>
> Wicked :-)
>
> Is in common (in the USA ?) to ask job applicants to provide examples
> of work done in past employment?

No.  Very unusual, IME.  Never happened to me in 20ish years.


> In the UK I reckon you're more
> likely to be asked to describe projects and answer more general
> questions.  How would you even know that the work was really their
> own?
>
> Maybe if coding skills are really crucial it might be better to set a
> few problems and leave them at a PC for an hour or two.
>
> Michael Saunby

-- 
Onedoctortoanother:"Ifthisismyrectalthermometer,wherethehell'smypen???"







==========================================================================
TOPIC: Question about EJB's
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d4a780fe530c2ba
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 4:04 am
From: "Darryl L. Pierce" <[EMAIL PROTECTED]> 

Anonymous wrote:

> I recently used websphere to make a few ejb's.
> I have a couple of questions...
> does one ejb object represent one record?

One _entity_ bean represents a single record (session beans don't). It is
also possible for an entity bean to consist of data from _different_
tables, but that's more advanced.

> how would you get an existing record in a table, and retreive it into
> the ejb?

Using a findXXXXX() method in the home (or remote) interface. You would
define this method and would supply the necessary key values as arguments
to the method.

> say you want to select name from products where supplierid=1.
> how would you do that with an ejb?

You would a method like this in your remote home interface:

SuppliedRemoteHome.find(int id)

If you're working with CMP then the contain handles tracking down the proper
record. If you're working with BMP then you'll have to write the code to
lookup the proper record.

> now that I know how to make ejbs, where would I find stuff on the
> internet that shows how to use them for querys/updates etc?

comp.lang.java.beans is a good start. There are also mailing lists, which
you can find at <http://archives.java.sun.com>, for EJB development.

-- 
/**
 * @author Darryl L. Pierce <[EMAIL PROTECTED]>
 * @see    The Infobahn Offramp <http://mcpierce.mypage.org>
 * @quote  "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
 */




==========================================================================
TOPIC: BOOK: Enterprise SOA
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fe965eb1b2cfafa
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 5:18 am
From: "James McGovern" <[EMAIL PROTECTED]> 

I am the co-author of the bestselling book: A Practical Guide to
Enterprise Architecture
(http://www.amazon.com/exec/obidos/tg/detail/-/0131412752/) and seek the
assistance of ten individuals to provide feedback on an upcoming book
tentatively entitled: Enterprise SOA

Of special interest are individuals who are knowledgable in:

* Security
* Event Driven Architecture
* Registries
* IT Governance

If interested, drop me a note ( j a m e s at a r c h i t e c t b o o k dot c
o m) and I will send you a copy in PDF format (Requires Acrobat 5.0 or
higher).

NOTE: My spam filter deletes all email from free email services such as
Yahoo, Hotmail, GMail, etc so use your work email to reply.

Cheers

James McGovern
Number Two Blogger on the Internet
http://blogs.ittoolbox.com/eai/leadership






==========================================================================
TOPIC: Start a windows program
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1b169b5fb0ad711e
==========================================================================

== 1 of 2 ==
Date:   Sat,   Sep 25 2004 5:43 am
From: [EMAIL PROTECTED] (Gary) 

Hi I was just wondering if it is possible to start a windows program
from within a java program? Maybe a .exe file?


Thank you for help



== 2 of 2 ==
Date:   Sat,   Sep 25 2004 5:50 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 25 Sep 2004 05:43:06 -0700, Gary wrote:

> ...possible to start a windows program
> from within a java program? 

See the various forms of Runtime.exec()
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#method_summary>

HTH

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane




==========================================================================
TOPIC: Why does this work for Canvas but not for JPanel?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/42cf2394a0e56b78
==========================================================================

== 1 of 4 ==
Date:   Sat,   Sep 25 2004 5:48 am
From: Jonck <[EMAIL PROTECTED]> 

Hi everybody,
I have a small Java app that allows you to move shapes around by clicking and 
dragging. The dragged shape has a dashed line to distinguish it from the original.

Now here is my question: when you run the code included at the bottom of this post it 
works just great. However, I would like to use this in a Swing app. So if I change the 
Mover class from Frame to JFrame and the MoverPanel from Canvas to JPanel I would 
expect things to work still (except on line 14 where you have to change add(mp) to 
getContentPane().add(mp)); after all, all method calls that are used here are valid 
for JPanel as well. But it doesn't work correctly, the dragged shape leaves behind a 
"trail", cluttering the JPanel very quickly.

Could anyone tell me how to translate this code to use Swing?

Thanks very much, Jonck

<code>

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
public class Mover extends Frame {
    public static void main(String[] arg) {
        new Mover();
    }
    Mover() {
        super("Mover");
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
                { System.exit(0); } } );
        MoverPanel mp = new MoverPanel();
        add(mp);
        pack();
        show();
    }
class MoverPanel extends Canvas
        implements MouseListener, MouseMotionListener {
    boolean moving = false;
    int moveIndex;
    int startx;
    int starty;
    int endx;
    int endy;
    Area[] area;
    AffineTransform at;
    BasicStroke dashes;
    MoverPanel() {
        addMouseListener(this);
        addMouseMotionListener(this);
        area = new Area[4];
        area[0] = new Area(new Ellipse2D.Float(10,10,40,40));
        area[1] = new Area(new Ellipse2D.Float(80,80,20,50));
        area[2] = new Area(new Ellipse2D.Float(130,130,60,60));
        area[3] = new Area(new Ellipse2D.Float(200,200,50,20));
        setSize(300,250);
        at = new AffineTransform();
        float[] pattern = { 5f,5f };
        dashes = new BasicStroke(1f,BasicStroke.CAP_BUTT,
                BasicStroke.JOIN_BEVEL,1f,pattern,0f);
    }
    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D)g;
        for(int i=0; i<area.length; i++)
            g2.draw(area[i]);
        if(moving) {
            g2.setTransform(at);
            g2.setStroke(dashes);
            g2.draw(area[moveIndex]);
        }
    }
    public void mouseMoved(MouseEvent event) {
        moving = false;
    }
    public void mouseDragged(MouseEvent event) {
        if(!moving)
            return;
        endx = event.getX();
        endy = event.getY();
        at.setToTranslation(endx - startx,endy - starty);
        repaint();
    }
    public void mousePressed(MouseEvent event) {
        moving = false;
        startx = event.getX();
        starty = event.getY();
        for(int i=0; i<area.length; i++) {
            if(area[i].contains(startx,starty)) {
                moving = true;
                moveIndex = i;
                at.setToTranslation(0,0);
                break;
            }
        }
    }
    public void mouseReleased(MouseEvent event) {
        if(moving) {
            area[moveIndex].transform(at);
            moving = false;
            repaint();
        }
    }
    public void mouseEntered(MouseEvent event) { }
    public void mouseExited(MouseEvent event) { }
    public void mouseClicked(MouseEvent event) { }
}
}

</code>



== 2 of 4 ==
Date:   Sat,   Sep 25 2004 5:56 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Sat, 25 Sep 2004 12:48:42 GMT, Jonck wrote:

> I have a small Java app that allows you to move 
> shapes around by clicking and dragging. The dragged 
> shape has a dashed line to distinguish it from the original.

Please shorten the lines in your posts, news clients
generally wrap at 72 chars.

> ..I change the Mover class from Frame to JFrame and the 
> MoverPanel from Canvas to JPanel ..

<http://www.physci.org/codes/javafaq.jsp#cljg>
...
> Could anyone tell me how to translate this code to use Swing?

You forgot (at least) one thing..
<http://www.physci.org/guifaq.jsp#2.4>

...
>     public void paint(Graphics g) {

public void paintComponent(Graphics g) {
..

HTH

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane



== 3 of 4 ==
Date:   Sat,   Sep 25 2004 6:22 am
From: Jonck <[EMAIL PROTECTED]> 

> Please shorten the lines in your posts, news clients
> generally wrap at 72 chars.

Ok, sorry about that. I have changed the settings for my newsreader, 
could you please confirm whether it's reading correctly for you this 
time?

> public void paintComponent(Graphics g) {

Thanks, you are of course right, I forgot to change paint to 
paintComponent. However, when I do incorporate this change the behavior 
is still incorrect, a dragged shape still leaves behind a "trail".

I'm sure I'm still doing something incorrect, as I've read many articles 
on people using AffineTransform with Swing, but I can't seem to be able 
to spot my mistake(s).

Thanks for your help, Jonck



== 4 of 4 ==
Date:   Sat,   Sep 25 2004 7:05 am
From: "Thomas G. Marshall" <[EMAIL PROTECTED]> 

Jonck coughed up:
>> Please shorten the lines in your posts, news clients
>> generally wrap at 72 chars.
>
> Ok, sorry about that. I have changed the settings for my newsreader,
> could you please confirm whether it's reading correctly for you this
> time?
>
>> public void paintComponent(Graphics g) {
>
> Thanks, you are of course right, I forgot to change paint to
> paintComponent. However, when I do incorporate this change the
> behavior is still incorrect, a dragged shape still leaves behind a
> "trail".
>
> I'm sure I'm still doing something incorrect, as I've read many
> articles on people using AffineTransform with Swing, but I can't seem
> to be able to spot my mistake(s).
>
> Thanks for your help, Jonck


Had you changed your code to this?

    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        ...
    }
-- 
Onedoctortoanother:"Ifthisismyrectalthermometer,wherethehell'smypen???"







==========================================================================
TOPIC: Difference between <jsp:useBean> and <bean:define> ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ada2085c54b155b
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 6:01 am
From: [EMAIL PROTECTED] (Anan H. Samiti) 

When I define something like the following in my ActionClass (in a Struts/JSP 
Architecture)

request.setAttribute("myVo", myVoObject);

I could access this object from my JSP page (as far as I know) by declaring a bean 
like:

<jsp:useBean id="myVo" class="mypackage.myVo" />

resp.

<bean:define id="myid" name="myVo" property="getVo" type="mypackage.myVo" />



But what is the difference?

Is the next html:text tag valid for both declarations?

<html:text name="myidValue" property="myValue" size="10" value="<%= myVo.getMyValue() 
%>" />

Anan





==========================================================================
TOPIC: How to replace all TABS in a currently opened java source file to BLANKS 
(Eclipse/Websphere)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/10428b4c71e4ee15
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 6:15 am
From: [EMAIL PROTECTED] (Peter Blatt) 

How do I replace all Tabs which a current java source file in Websphere Eclipse) 
contains by blanks.
I found a place where I defined by how MANY blanks a tab is replaced but not which key 
I have to press
to do the replacement.

Peter





==========================================================================
TOPIC: writeObject and readObject problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e6fc9480a3a7f42a
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 6:21 am
From: "juicy" <[EMAIL PROTECTED]> 

Andrew Thompson wrote:

>Your exception handling could be simplified by putting 
>everything in the method within a single try/catch.
ok. I am still a beginner in java...

> (In case you are 
*compiling* with MS SDK - stop it and use Sun 
Java with options)

I must use MSVM to run my another virtual reality part which is controlled

by java applet, if not, i will get all the exception like below. 

java.lang.UnsatisfiedLinkError: getBrowserType
        at vrml.cosmo.Browser.getBrowserType(Native Method)
        at vrml.external.Browser.getBrowser(Browser.java)
        at vrml.external.Browser.getBrowser(Browser.java)
        at VE.init(VE.java:118)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

java.lang.UnsatisfiedLinkError: getBrowserType
        at vrml.cosmo.Browser.getBrowserType(Native Method)
        at vrml.external.Browser.getBrowser(Browser.java)
        at vrml.external.Browser.getBrowser(Browser.java)
        at VE.init(VE.java:118)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

java.lang.UnsatisfiedLinkError: getBrowserType
        at vrml.cosmo.Browser.getBrowserType(Native Method)
        at vrml.external.Browser.getBrowser(Browser.java)
        at vrml.external.Browser.getBrowser(Browser.java)
        at VE.init(VE.java:118)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

java.lang.UnsatisfiedLinkError: getBrowserType
        at vrml.cosmo.Browser.getBrowserType(Native Method)
        at vrml.external.Browser.getBrowser(Browser.java)
        at vrml.external.Browser.getBrowser(Browser.java)
        at VE.init(VE.java:118)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

>method 'action()' is also deprecated.
Why method ation is deprecated?

>If you are interested in ActionEvents, as you seem to be ->with the
button clicks, why not implement ActionListener >and send an ActionEvent?
If i implement ActionListener and send an ActionEvent, the result is still
same if i run the code with MSVM, right?

I don't know who is still willing offer help... what should i do now?? I
will really appreaciate your help!!





==========================================================================
TOPIC: Garbage collector question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/793ab88313c687f9
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 6:31 am
From: "xarax" <[EMAIL PROTECTED]> 

"Vincent Cantin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Object yourObject = weakReference.get();
> > if(yourObject != null) System.out.println("Yes, your object is
> > reachable at this very moment,
> > and at least as long as 'yourObject' variable refers it ");
>
> No .. this means weakly reachable, and *perhaps* no longer simply reachable.

Placing the reference into "yourObject" makes
it strongly reachable. So, the println message
is correct at the time it is executed.






==========================================================================
TOPIC: I got the Herbert Schilt, (Java 2) Package blues. Please help before I shoot 
the dog
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f29e821306447a70
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 6:32 am
From: "Gary Labowitz" <[EMAIL PROTECTED]> 

"Andrew Thompson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 25 Sep 2004 01:31:21 -0400, Gary Labowitz wrote:
>
> > I don't know if the wiki is still being updated (and where is Jon Skeet,
> > anyway?), ..
>
> Jon is alive and well
> <http://google.com/groups?as_uauthors=jon+skeet>
>
> And posting actively, to groups other than those
> that most of us are used to reading him on..
>
<http://google.com/groups?as_uauthors=jon+skeet&group=microsoft.public.dotne
t.*>

Oooooooo.... he went over to the dot net side.
"I have you now...." [Bill Gates]
-- 
Gary






==========================================================================
TOPIC: Java trick
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfd25be52dc6a3ad
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 25 2004 6:36 am
From: "Thomas G. Marshall" <[EMAIL PROTECTED]> 

P.Hill coughed up:
> Thomas G. Marshall wrote:
>> When I teach students, I'm similarly faced with being extremely
>> careful in my wording.
>
> When you say the following, you have the usage of "type" and "class"
> exactly reversed, as Joona said:


[note to all]

Since we've now put the primary issue of this thread to rest, I thought I'd
point something out I find both interesting and important to us all.

Because I've discovered that in my 8+ years of OO that one of the greatest
sources of arguments (primarily in usenet) seems to center *(often
unknowingly)* around what is meant by the following:

        The type of {something}

...I posted a question in c.o concerning the terminology of type when
referring to poly-m objects.

The responses I got were, as you would expect, varied.  Very heavy hitting
stuff in some cases, as is common among the purists in c.o, many of them
authors of multiple OO books.

I would suggest /anyone/ read through it here (it's short):

http://groups.google.com/groups?threadm=yMY2d.1156%249l1.252%40trndny09

...[rip]...

-- 
Onedoctortoanother:"Ifthisismyrectalthermometer,wherethehell'smypen???"






=======================================================================

You received this message because you are subscribed to the
Google Groups "comp.lang.java.programmer".  

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


=======================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to