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

Today's topics:

* Response Control Problem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c5a87cc67b0d2f8
* YHBT (Was: Re: braindead languages?) - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c6ebaa9cc432a569
* How to translate Japanese String into UTF-32 encoded using Java APIs ? - 1 
messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c01f1e464ef13e3
* Implicit object creation - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7ea9ee9cb601f58c
* Is instanceof dirty? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/395347a70489adef
* ZipOutputStream, ZipFile and Linux unzip do not agree on the file count in 
zip - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7aced318b9e04b5c
* tomcat vs. resin - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/86085f5203580e61
* jar question - 7 messages, 5 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e00c9cb51a3d4eea
* Execute problem with JCreator - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b864ab013f6b9085
* basic question on Java in XP - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fdd3c20697a0a9e9
* Java Newbie Question - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/518575c9575bb2bb
* Bindenlicht - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/94c73395859bdd98
* who uses algorithms learned in cs studies? - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/640d2fa7355d4dcf
* Java client connected to non-Java server problems - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9dcb548fa77a4b46
* Java-COM - 2 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fdbbefb09d18e616
* Java newbie: RMI woes on Linux - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96a016c1721dc337
* Does Java CGI Require Thread Management - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2b0427cecdf178b
  
==========================================================================
TOPIC: Response Control Problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c5a87cc67b0d2f8
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 1:12 pm
From: [EMAIL PROTECTED] (researcher) 

I am trying to connect to IBM Directory server using Sun JNDI
implementation. The scenario: Connecting to the directory using an
expired password. When I do this I expect to get a Password Expiration
response control that indicates that the password has been expired.
However when i execute the code I get no response control. The context
returned is null. Snippet of my code is shown below:
        Hashtable env = new Hashtable(11);
        env.put(    Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://.../";);
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "dn...");
        env.put(Context.SECURITY_CREDENTIALS, "...");
Control[] ctls = new Control[] {new PasswordPolicyRequestControl()};

ldapctx = new InitialLdapContext(env,ctls);

It throws AuthenticationException where I try to get the response
control but it returns null.

Thanks.

Ashish




==========================================================================
TOPIC: YHBT (Was: Re: braindead languages?)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c6ebaa9cc432a569
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 1:21 pm
From: Sherm Pendley <[EMAIL PROTECTED]> 

Please don't feed the troll by replying to this. Note where followups 
are directed - she obviously intends to sabotage the Perl group by 
flooding it with outraged flames from the denizens of the C++ and Java 
groups.

sherm--




==========================================================================
TOPIC: How to translate Japanese String into UTF-32 encoded using Java APIs ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c01f1e464ef13e3
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 1:21 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 9 Nov 2004 12:56:20 -0800, Marat wrote:

> The following work arrounds throws exceptions :

Is that an InsufficientStrawberriesException?  No?
Well perhaps you had better be more precise.
<http://www.physci.org/codes/javafaq.jsp#exact>

And, please do not repost your question, especially 
after just 5 minutes.

-- 
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: Implicit object creation
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7ea9ee9cb601f58c
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 2:40 pm
From: "Hal Rosser" <[EMAIL PROTECTED]> 


"RHC" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a question regarding garbage collection.  Assume the following
>
> public class Myclass
> {
>   public Myclass()
>   {}
>   public int getTheNumberOne()
>   { return 1;}
>
> }
>
> Now suppose in some other class, say a servlet or something I have the
following..
>
> int first = new Myclass().getTheNumberOne();
>
> when / how is this new Object of type Myclass garbage collected???
>
> TIA
>
> RHC

That's the good thing about it - you don't need to know - its taken care of
by the jvm


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004






==========================================================================
TOPIC: Is instanceof dirty?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/395347a70489adef
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 2:57 pm
From: George Neuner <[EMAIL PROTECTED]> 

On Mon, 08 Nov 2004 18:04:14 GMT, DeMarcus <[EMAIL PROTECTED]> wrote:

>
>Hi,
>
>I come from the C++ world and there they say "no no" when
>you want to switch on type information.

Where did you get that idea?  Many dynamic object creation problems
can require code to deliberately switch on object types.

>Even the inventor of C++ say so.

Stroustrap has never said "don't do it" - rather he has repeatedly
said that RTTI is a powerful mechanism that should be used
responsibly.  C++ code that explicitly uses run time type information
is generally not portable and requires above average attention to
detail.

RTTI query support was left implementation specific in the first
versions of the C++ language standard (I don't have the latest version
available to check if it is still the case).  Stroustrap's early books
on C++ include examples using the standard cast operators to construct
an ad-hoc type query mechanism for cases where native compiler RTTI
query support was not available.


>What's the common opinion about using the java keyword
>instanceof?

The functionality would not have been provided if Java's designers
didn't think it was needed.  In contrast to the C++ crowd, they were
nice enough to provide a standard way to query RTTI from the start.

Using "instanceof" in Java is a perfectly acceptible way to write code
that must manipulate versioned interfaces (just as the equivalent code
would be in C++).  Others have mentioned alternate good uses for it as
well.


George

-- 
for email reply remove "/" from address




==========================================================================
TOPIC: ZipOutputStream, ZipFile and Linux unzip do not agree on the file count 
in zip
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7aced318b9e04b5c
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 3:22 pm
From: Real Gagnon <[EMAIL PROTECTED]> 

> I think there is a bug in ZipFile...
> 
> I use ZipOutputStream to build a zip file.  The program zipped 72417
> files, but after checking it with ZipFile, ZipFile.size() reported
> only 6881 files in the file.  So unfortunately, Java is unable to read
> all the entries in the zip file, but Linux's PK-INFO (unzip) is able
> to read the file.
> 

It's possible, check this bug 
"Cannot handle zip files with more than 65535 files" at

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5084334

Bye.
-- 
Real Gagnon  from  Quebec, Canada
* Looking for Java or PB snippets ? Visit Real's How-to  
* http://www.rgagnon.com/howto.html




==========================================================================
TOPIC: tomcat vs. resin
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/86085f5203580e61
==========================================================================

== 1 of 2 ==
Date:   Tues,   Nov 9 2004 3:45 pm
From: "Ryan" <[EMAIL PROTECTED]> 

has anyone used both of these? anyone have opinions of how they compare? 





== 2 of 2 ==
Date:   Tues,   Nov 9 2004 7:01 pm
From: SMC <[EMAIL PROTECTED]> 

On Wed, 10 Nov 2004 10:45:19 +1100, Ryan wrote:

> has anyone used both of these? anyone have opinions of how they compare?
 
Resin made great claims to *much* better performance, however I compared
our rather big JSP based site running on both (on the same hardware) and
could barely tell the difference. We stuck with Tomcat (4.1) since its
performance was comparable, and it's open source and free (as in beer).

-- 
Sean

"I love deadlines. I love the sound they make as they Whoosh by" -
Douglas Adams




==========================================================================
TOPIC: jar question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e00c9cb51a3d4eea
==========================================================================

== 1 of 7 ==
Date:   Tues,   Nov 9 2004 3:51 pm
From: "hilz" <[EMAIL PROTECTED]> 

Hi all:

I am trying to create a library "myLib.jar" that includes three other jar
files:

    myLibA.jar
    myLibB.jar
    myLibC.jar

I want myLib.jar to contain only myLibA.jar, myLibB.jar and myLibC.jar and a
manifest file
what do i need to include in the manifest file such that when an application
adds myLib.jar to its classpath, it will have access to the three included
libraries?

is that possible at all? if not, then what is the alternative?

thanks in advance for any answers or pointers.
hilz






== 2 of 7 ==
Date:   Tues,   Nov 9 2004 4:42 pm
From: "Wendy S" <[EMAIL PROTECTED]> 

"hilz" <[EMAIL PROTECTED]> wrote:
> what do i need to include in the manifest file such that when an
application
> adds myLib.jar to its classpath, it will have access to the three included
> libraries?
> is that possible at all? if not, then what is the alternative?

I don't think jar-within-jar will work, though I've never tried it.  I would
(use Ant to) expand all three .jar files into the same directory structure
and then re-pack all the "loose" files into one .jar file.

-- 
Wendy





== 3 of 7 ==
Date:   Tues,   Nov 9 2004 5:05 pm
From: "Ann" <[EMAIL PROTECTED]> 


"hilz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all:
>
> I am trying to create a library "myLib.jar" that includes three other jar
> files:
>
>     myLibA.jar
>     myLibB.jar
>     myLibC.jar
>
> I want myLib.jar to contain only myLibA.jar, myLibB.jar and myLibC.jar and
a
> manifest file
> what do i need to include in the manifest file such that when an
application
> adds myLib.jar to its classpath, it will have access to the three included
> libraries?
>
> is that possible at all? if not, then what is the alternative?
>
> thanks in advance for any answers or pointers.
> hilz

Why don't you want 4 manifest files?





== 4 of 7 ==
Date:   Tues,   Nov 9 2004 5:15 pm
From: "hilz" <[EMAIL PROTECTED]> 

>
> Why don't you want 4 manifest files?
>

i am not against 4 manifest files.
how would that work?
what would each of them contain?

thanks
hilz






== 5 of 7 ==
Date:   Tues,   Nov 9 2004 5:18 pm
From: "KC Wong" <[EMAIL PROTECTED]> 

"hilz" <[EMAIL PROTECTED]> wrote in message
> I am trying to create a library "myLib.jar" that includes three other jar
> files:
>
>     myLibA.jar
>     myLibB.jar
>     myLibC.jar
>
> I want myLib.jar to contain only myLibA.jar, myLibB.jar and myLibC.jar and
a
> manifest file
> what do i need to include in the manifest file such that when an
application
> adds myLib.jar to its classpath, it will have access to the three included
> libraries?
>
> is that possible at all? if not, then what is the alternative?

Impossible.

Extract myLibX.jar and re-jar them together as myLib.jar, or distribute them
separately.





== 6 of 7 ==
Date:   Tues,   Nov 9 2004 7:40 pm
From: Dave Glasser <[EMAIL PROTECTED]> 

"hilz" <[EMAIL PROTECTED]> wrote on Tue, 9 Nov 2004 18:51:24 -0500 in
comp.lang.java.programmer:

>Hi all:
>
>I am trying to create a library "myLib.jar" that includes three other jar
>files:
>
>    myLibA.jar
>    myLibB.jar
>    myLibC.jar
>
>I want myLib.jar to contain only myLibA.jar, myLibB.jar and myLibC.jar and a
>manifest file
>what do i need to include in the manifest file such that when an application
>adds myLib.jar to its classpath, it will have access to the three included
>libraries?
>
>is that possible at all? 

No it's not, although a lot of people have wanted to do it.

It's theoretically possible to write a ClassLoader that would
accomplish this, but it probably wouldn't be practical. The reason is
that, in order to search for classes in, and extract them from, the
internal jar files, you'd have to first extract and decompress the
internal jars to memory or a temporary file anyway.

>if not, then what is the alternative?

As someone mentioned, about the only practical way to accomplish this
is to merge the contents of all your jars into a single jar.


-- 
Check out QueryForm, a free, open source, Java/Swing-based
front end for relational databases.

http://qform.sourceforge.net

If you're a musician, check out RPitch Relative Pitch
Ear Training Software.

http://rpitch.sourceforge.net



== 7 of 7 ==
Date:   Tues,   Nov 9 2004 8:06 pm
From: "hilz" <[EMAIL PROTECTED]> 

Thanks to all.
i guess i will have to do just that - extract everything and re-jar
everything in one file.

many thanks for the quick responses.
hilz






==========================================================================
TOPIC: Execute problem with JCreator
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b864ab013f6b9085
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 4:50 pm
From: "Ann" <[EMAIL PROTECTED]> 


"Andrew Thompson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 09 Nov 2004 18:21:58 GMT, Mark K wrote:
>
> > If you dont have an answer or can provide any help, please dont post!
>
> I have done this conversation too many times to do it again
> for yet another 'screaming noob', I'm too busy at the moment.
> So I'll ask you straight up.  Are you more interested in ..
> a) Learning Java?
> b) P*ssing off those who are trying to help you?
>
Spoiled little rich kids to this a lot.






==========================================================================
TOPIC: basic question on Java in XP
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fdd3c20697a0a9e9
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 5:05 pm
From: "Cynthia Campbell" <[EMAIL PROTECTED]> 

Hi Andrew,

Thanks for your comments. Re, your last comment, I re-affirm that IE6 shows
NOTHING (except a large blank square with a tiny square red "x" in the upper
left - IE's "can't load graphic" icon..)  When I use FireFox, I get a
drop-down select, then below a grey square with the info chosen in the
drop-down visible.

I even went into IE6 tools/options and ENABLED all the Java options in
advanced (Java Sun, Java console, Java logging and Java compiler).  I then
re-booted the whole system, but the web-link still gave the
"empty/no-graphic" icon described above.

As far as the "regonline" tutorial, I'll have to check with their tech
support to see what they require.  Nonetheless, I would like to get IE6
Java-friendly if possible.

Cynthia






==========================================================================
TOPIC: Java Newbie Question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/518575c9575bb2bb
==========================================================================

== 1 of 2 ==
Date:   Tues,   Nov 9 2004 5:16 pm
From: [EMAIL PROTECTED] (ryan) 

I need some advice on how to develop somethng. The site below has some
java applets that allow you to move some 3-d shapes around. I have a
professor that needs a similar model created. What can I use
softwarewise to develop something like these. I've never used java but
can learn fast through example. Can you point me to any advice or
examples that would help me make something like the models on the site
below? I appreciate any help very much.

http://mathworld.wolfram.com/Tetrahedron.html



== 2 of 2 ==
Date:   Tues,   Nov 9 2004 6:08 pm
From: Real Gagnon <[EMAIL PROTECTED]> 

[EMAIL PROTECTED] (ryan) wrote in news:a7fdaa26.0411091716.6502a832
@posting.google.com:

> I need some advice on how to develop somethng. The site below has some
> java applets that allow you to move some 3-d shapes around. 

Check in the demo\Applets\WireFrame directory in your installation of the 
JDK. 

Bye.
-- 
Real Gagnon  from  Quebec, Canada
* Looking for Java or PB snippets ? Visit Real's How-to  
* http://www.rgagnon.com/howto.html




==========================================================================
TOPIC: Bindenlicht
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/94c73395859bdd98
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 5:30 pm
From: "Thomas Smith" <[EMAIL PROTECTED]> 

Has anyone else out here played with Bindenlicht? And, if you have, you 
taken a look at the particle system?  I am trying to familiarize myself with 
the particle system from Irrlicht, and want to be sure that the particle 
system bindings are working properly.


-- 
Thomas W. Smith
Senior Engineer 






==========================================================================
TOPIC: who uses algorithms learned in cs studies?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/640d2fa7355d4dcf
==========================================================================

== 1 of 3 ==
Date:   Tues,   Nov 9 2004 6:05 pm
From: "bebop o'saurus" <[EMAIL PROTECTED]> 

hi everybody,

i am wondering:

1) does anybody here use (in their everyday java coding gigs) any of the 
algorithms they were taught in their cs classes?

2) what algorithms learned in your cs studies have you used recently?

3) if you haven't used any cs studies algorithms in your real-world jobs, 
why not?

4) if you do use any cs algorithms in your real-world jobs, how often do you 
use them?

thanks in advance for your replies. 





== 2 of 3 ==
Date:   Tues,   Nov 9 2004 6:55 pm
From: SMC <[EMAIL PROTECTED]> 

On Wed, 10 Nov 2004 13:05:17 +1100, bebop o'saurus wrote:

> 1) does anybody here use (in their everyday java coding gigs) any of the
> algorithms they were taught in their cs classes?
> 
> 2) what algorithms learned in your cs studies have you used recently?
> 
> 3) if you haven't used any cs studies algorithms in your real-world
> jobs, why not?
> 
> 4) if you do use any cs algorithms in your real-world jobs, how often do
> you use them?

Almost always, the interesting and useful (and simple) algorithms are
available in the existing core Java API classes. Reimplementing well known
algorithms everytime would be brain dead (and contrary to the ideals of
OOP).

-- 
Sean

I'm not a complete idiot - parts of me are missing



== 3 of 3 ==
Date:   Tues,   Nov 9 2004 7:28 pm
From: "stev<nospam>uote_ehncd.com" <"stev<nospam>uote_ehncd.com"> 

bebop o'saurus wrote:
> hi everybody,
> 
> i am wondering:
> 
> 1) does anybody here use (in their everyday java coding gigs) any of the 
> algorithms they were taught in their cs classes?

Uhm, recursion is a definite need to know.  There are probably some 
others I don't remember.


> 
> 2) what algorithms learned in your cs studies have you used recently?

See above...although all collections are nice to know how they are done...
Linked List, Binary Trees, Hashtables, etc.

> 
> 3) if you haven't used any cs studies algorithms in your real-world jobs, 
> why not?

uh.
> 
> 4) if you do use any cs algorithms in your real-world jobs, how often do you 
> use them?
> 

Quite a bit, all these questions sound the same, a recursion if you will.

> thanks in advance for your replies. 
> 
> 

no, thank you in advance of your advance.




==========================================================================
TOPIC: Java client connected to non-Java server problems
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9dcb548fa77a4b46
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 6:22 pm
From: [EMAIL PROTECTED] (Illusionistx) 

I'm trying to connect a java client application to a chat server i
wrote in vb. i know the server works, and i know the client works(when
used with a java server), but when i use the vb server and the java
client, the client doesn't get the data sent from the server. But then
when i send back from the client to the server, then what i sent from
the server shows up, so it's like the buffer isn't getting read or
flushed when i send from the server. What is the best approach i
should take on this?




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

== 1 of 2 ==
Date:   Tues,   Nov 9 2004 6:45 pm
From: "Ike" <[EMAIL PROTECTED]> 

Anyone know of a freeware Java-COM bridge ? -Ike





== 2 of 2 ==
Date:   Tues,   Nov 9 2004 7:26 pm
From: "Ike" <[EMAIL PROTECTED]> 

JACOB....thats it...now I remember!

"Ike" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Anyone know of a freeware Java-COM bridge ? -Ike
>
>






==========================================================================
TOPIC: Java newbie: RMI woes on Linux
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96a016c1721dc337
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 7:00 pm
From: [EMAIL PROTECTED] (Andy) 

I am a java newbie and was trying my hand at RMI. I have an interface,
a server implementing that interface and a utility class with "public
static void main" to register the server class. I also have a client,
which calls the server using Naming.lookup(...) and calls methods on
it.
Of course, before binding the server I start the rmiregistry on my
local machine, without specifying the port and by specifying the
following option:

        -J-Djava.security.policy=E:\mydir\...\rmiserver.policy

Later, when I try to register the server, the registration fails with
an access denied error on localhost:1099.

The policy file I am using is simple:

grant{
        permission java.security.AllPermissions;
};

Any pointers would be greatly appreciated.

IMP: I am facing this problem on my Linux box. Whereas on my Windows,
a similar program runs without cribs. (No advocacy meant for Windows.)

Cheers,
Andy




==========================================================================
TOPIC: Does Java CGI Require Thread Management
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2b0427cecdf178b
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 9 2004 7:57 pm
From: Dave Glasser <[EMAIL PROTECTED]> 

[EMAIL PROTECTED] (JR) wrote on 9 Nov 2004 08:42:10 -0800 in
comp.lang.java.programmer:

>Hi.  I have about about two dozens CGI scripts written in Perl that I
>need to convert to Java.  The machine on which these scripts reside
>doesn't support servlets, so I'm stuck with converting basic CGI from
>one language to another.  

I'm curious, how could a machine support a JVM but not servlets?
Tomcat is free and fairly lightweight. If your machine can support
running Java programs as CGI processes, which would entail multiple
concurrent running JVMs on a busy server, it should handle Tomcat
without a problem.


>With any CGI, regardless of language, is it
>necessary to manage threads, or is that taken care of by the server
>handling the request?  My limited understanding is that a CGI request
>will spawn a new process, and create a unique thread for that process.

That's right.

>
>Also, I'd like one day to be able to move the Java CGI programs that I
>will write as part of the above conversion to a machine that does
>support servlets.  I'd appreciate any recommendations as to references
>that clearly explain how to handle the multi-threaded capability of
>servlets.  My only experience with threads so far is work from a
>chapter of Ivor Horton's Beginning Java 2.  The concepts seem pretty
>difficult to grasp, and I'm not sure how I could apply them to an a
>servlet that may have from x to y number of possible threads.  It
>would be awesome if there were a thread manager class that handled
>threads for the programmer, but I'm probably missing the point of
>threads to hope for that.

The main thing you'd have to do would be to avoid using instance
variables in a servlet or JSP, since other threads (simultaneous
requests to the same servlet or JSP) would be able to change their
value. Use local variables to reference data that can change during
the course of a request.



-- 
Check out QueryForm, a free, open source, Java/Swing-based
front end for relational databases.

http://qform.sourceforge.net

If you're a musician, check out RPitch Relative Pitch
Ear Training Software.

http://rpitch.sourceforge.net



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

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