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

Today's topics:

* Setting "root" in Tomcat - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6adf1698a52bbc81
* problem deploying jsps with tomcat - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/99818e82b7db6bcc
* Python style "generator" equivalent for Java? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23d0596f3f7f4159
* static variables in web applications versus standalone application - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4f5b38d2ba5edd3a
* current date/time function - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/42d6dd3f5f72995a
* How to paint in Component Graphics? - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c10fbaedc6c93664
* port number for web applications in jboss - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79a48673850acf8f
* Memory sensitive caches - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/847960ed2b3fe4f4
* Question about passing values? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fe1c15e0fc2a949
* Tool for sharing C data-structures with Java - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bf1b9c3fa7ec6f0b
* looking for high-level web development tools - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b726dc72d5129bda
* .exe Launched Java App -- How's It Working? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5fd9b8a5d2a9b437
* Need as much help as possible - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c8e64b34d7154d8
* Writting data to a SocketChannel using NIO - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/73de6bca3d676791
* Is session id machine independent and unique? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/94c349e02b2efcb4
  
==========================================================================
TOPIC: Setting "root" in Tomcat
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6adf1698a52bbc81
==========================================================================

== 1 of 3 ==
Date:   Fri,   Nov 12 2004 5:25 pm
From: [EMAIL PROTECTED] (2kuser) 

Hi,

I've installed Tomcat 4.1.31 on with JVM 1.4.2_04-b04  on a WinXP
machine.

In a JSP I have the following code to test where it allocates new
files:

        File outputfile = new File("findme.txt");
        outputfile.createNewFile();

When I run it, it creates the "findme.txt" file in:

C:\Documents and Settings\trent\Start Menu\Programs\Apache Tomcat 4.1

This seems to be an odd place, and I've scoured all the configuration
files, environment variables etc. to try to find where to set this to
a different directory.

Any suggestions?

Thanks!
Trent.



== 2 of 3 ==
Date:   Fri,   Nov 12 2004 6:58 pm
From: "Wendy S" <[EMAIL PROTECTED]> 

"2kuser" <[EMAIL PROTECTED]> wrote:
> I've installed Tomcat 4.1.31 on with JVM 1.4.2_04-b04  on a WinXP
> machine.
> In a JSP I have the following code to test where it allocates new
> files:
> File outputfile = new File("findme.txt");
> outputfile.createNewFile();
> When I run it, it creates the "findme.txt" file in:
> C:\Documents and Settings\trent\Start Menu\Programs\Apache Tomcat 4.1
> This seems to be an odd place, and I've scoured all the configuration
> files, environment variables etc. to try to find where to set this to
> a different directory.
> Any suggestions?

The Servlet specification requires the container to provide you with a place 
to write temporary files, check SRV.3.7.1 for full details.  (Retrieve 
context attribute javax.servlet.context.tempdir for the path.)  Or create 
your own context parameter in web.xml and specify a path, then use that to 
place your files in a known location.

The problem with what you're doing is that as you've noticed, the file can 
land in odd places depending on how and by what user Tomcat is started. 
Server admins aren't going to be happy with you trying to write files all 
over the place, and they may even have the directories marked read only so 
you can't do it.

-- 
Wendy in Chandler, AZ 





== 3 of 3 ==
Date:   Fri,   Nov 12 2004 8:45 pm
From: Sudsy <[EMAIL PROTECTED]> 

Wendy S wrote:
> "2kuser" <[EMAIL PROTECTED]> wrote:
<snip>
> The Servlet specification requires the container to provide you with a place 
> to write temporary files, check SRV.3.7.1 for full details.  (Retrieve 
> context attribute javax.servlet.context.tempdir for the path.)  Or create 
> your own context parameter in web.xml and specify a path, then use that to 
> place your files in a known location.
> 
> The problem with what you're doing is that as you've noticed, the file can 
> land in odd places depending on how and by what user Tomcat is started. 
> Server admins aren't going to be happy with you trying to write files all 
> over the place, and they may even have the directories marked read only so 
> you can't do it.

Wendy is quite correct. Do investigate ServletContext#getRealPath, however.
Try this link (for 1.4 at least):
<http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)>

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: problem deploying jsps with tomcat
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/99818e82b7db6bcc
==========================================================================

== 1 of 3 ==
Date:   Fri,   Nov 12 2004 6:16 pm
From: "Ryan" <[EMAIL PROTECTED]> 

The only java beans I can get to work are the ones that come in the example 
directory.

I made a simple jsp and put it in the 'cal' package under the examples 
directory. It works fine if use the TableBean that comes with tomcat as 
follows:

<jsp:useBean id="table" scope="session" class="cal.TableBean" />

If I save TableBean as TableBean2.java and I only change the class name and 
the constructor to TableBean2 and recompile, I then use the following to 
call it in my jsp

<jsp:useBean id="table" scope="session" class="cal.TableBean2" />

I get the following set of errors: I get these errors everywhere I use a 
bean I create. I do not get errors when I use the default beans. Is there a 
configuration parameter i need to set? I don't see it in any books.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp

Generated servlet error:
    [javac] Compiling 1 source file

C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:63: 
cannot resolve symbol
symbol  : class TableBean2
location: package cal
      cal.TableBean2 table = null;
         ^



An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp

Generated servlet error:
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:65: 
cannot resolve symbol
symbol  : class TableBean2
location: package cal
        table = (cal.TableBean2) pageContext.getAttribute("table", 
PageContext.SESSION_SCOPE);
                    ^



An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp

Generated servlet error:
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:68: 
cannot resolve symbol
symbol  : class TableBean2
location: package cal
            table = (cal.TableBean2) 
java.beans.Beans.instantiate(this.getClass().getClassLoader(), 
"cal.TableBean2");
                        ^
3 errors





== 2 of 3 ==
Date:   Fri,   Nov 12 2004 7:18 pm
From: [EMAIL PROTECTED] 

I think you got a tomcat configuration error

I ran into a problem similar to this, what I did wrong is that my
tomcat is run by a JVM older than java Compiler that I used.

What I would do, is install java and tomcat from scratch and try it
again.

hope this help

Ryan wrote:
> The only java beans I can get to work are the ones that come in the
example
> directory.
>
> I made a simple jsp and put it in the 'cal' package under the
examples
> directory. It works fine if use the TableBean that comes with tomcat
as
> follows:
>
> <jsp:useBean id="table" scope="session" class="cal.TableBean" />
>
> If I save TableBean as TableBean2.java and I only change the class
name and
> the constructor to TableBean2 and recompile, I then use the following
to
> call it in my jsp
>
> <jsp:useBean id="table" scope="session" class="cal.TableBean2" />
>
> I get the following set of errors: I get these errors everywhere I
use a
> bean I create. I do not get errors when I use the default beans. Is
there a
> configuration parameter i need to set? I don't see it in any books.
>
> org.apache.jasper.JasperException: Unable to compile class for JSP
>
> An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp
>
> Generated servlet error:
>     [javac] Compiling 1 source file
>
>
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:63:

> cannot resolve symbol
> symbol  : class TableBean2
> location: package cal
>       cal.TableBean2 table = null;
>          ^
>
>
>
> An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp
>
> Generated servlet error:
>
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:65:

> cannot resolve symbol
> symbol  : class TableBean2
> location: package cal
>         table = (cal.TableBean2) pageContext.getAttribute("table",
> PageContext.SESSION_SCOPE);
>                     ^
>
>
>
> An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp
>
> Generated servlet error:
>
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:68:

> cannot resolve symbol
> symbol  : class TableBean2
> location: package cal
>             table = (cal.TableBean2)
> java.beans.Beans.instantiate(this.getClass().getClassLoader(),
> "cal.TableBean2");
>                         ^
> 3 errors




== 3 of 3 ==
Date:   Fri,   Nov 12 2004 8:49 pm
From: Sudsy <[EMAIL PROTECTED]> 

Ryan wrote:
> The only java beans I can get to work are the ones that come in the example 
> directory.
> 
> I made a simple jsp and put it in the 'cal' package under the examples 
> directory. It works fine if use the TableBean that comes with tomcat as 
> follows:
> 
> <jsp:useBean id="table" scope="session" class="cal.TableBean" />
> 
> If I save TableBean as TableBean2.java and I only change the class name and 
> the constructor to TableBean2 and recompile, I then use the following to 
> call it in my jsp
<snip>

So how, precisely, did you compile it? If I was in the cal subdirectory
then I would issue the following command:

   javac -d .. TableBean2.java

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: Python style "generator" equivalent for Java?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23d0596f3f7f4159
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 6:45 pm
From: "Robert Oschler" <[EMAIL PROTECTED]> 

Hello,

I just finished a project that was in Python.  It used Python's generators
which I became fond of.  I am now working on a project that uses Java to
control a robot interface so I will be writing my code in Java.

If someone has found a way to add Python style generators to Java, I'd like
to know about it.

Thanks.


-- 
Robert Oschler
http://www.robotsrule.com/phpBB2/
Robot & Android Discussion Forum






==========================================================================
TOPIC: static variables in web applications versus standalone application
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4f5b38d2ba5edd3a
==========================================================================

== 1 of 2 ==
Date:   Fri,   Nov 12 2004 7:30 pm
From: [EMAIL PROTECTED] 

The static variable dies in a standalone application, because the
garbage collector cleans all your object because you application has
ended.

But if you are using this in a servlet or jsp, your application is not
dead until your web server dies. So even if you closes the web browser,
your web server is not close. Try to shut down your tomcat and you
variable will be no more.

hope this help




== 2 of 2 ==
Date:   Sat,   Nov 13 2004 12:38 am
From: "Mike Schilling" <[EMAIL PROTECTED]> 


"Tony Morris" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> "Matt" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> When we declare static variable in a standalone application,
>> the lifetime of a static variable begins from the execution of the 
>> program
>> untill the termination of the program.
>>
>> When we declare static variable in a web application,
>> the lifetime of a static variable begins from the the start of the web
> application
>> in web server, untill the web application is stopped in web server.
>> At first, I thought the lifetime of a static variable in a web 
>> application
> is
>> from opening the web browser until the web browser closes, that is 
>> session
>> lifetime, and now I realize it is wrong.
>>
>> Please confirm the concept. Thanks
>
> The 'lifetime' of a static member is the same as the class that 
> encapsulates
> it.
> The 'lifetime' of a class is from the moment it is loaded from the time it
> is unloaded.
> A class is loaded "on-demand" as per VM Specification.
> A class is unloaded when the VM system class loader cache dies, which is 
> at
> VM exit time.

A class is unloaded when the classloader which loaded it is unloaded.  If 
this is a web-application-specific classloader, this may happen when the 
application exits or sometime thereafter.  Ot it may not, depending both on 
the VM implementation and on the container's classloader implementation. 






==========================================================================
TOPIC: current date/time function
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/42d6dd3f5f72995a
==========================================================================

== 1 of 2 ==
Date:   Fri,   Nov 12 2004 7:31 pm
From: [EMAIL PROTECTED] (zxcv) 

Is there a function in Java that will return the current date/time? 
If so, were does it get the value from (system)?



== 2 of 2 ==
Date:   Fri,   Nov 12 2004 11:09 pm
From: Michael Rauscher <[EMAIL PROTECTED]> 

zxcv wrote:
> Is there a function in Java that will return the current date/time? 

Of course.

> If so, were does it get the value from (system)?

Hmm, AFAIR Java does neither have a crystal ball nor can it ensure that 
there's a network connection to a time server. So, it should be the 
local system where it gets the value from... SCNR

Bye
Michael




==========================================================================
TOPIC: How to paint in Component Graphics?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c10fbaedc6c93664
==========================================================================

== 1 of 3 ==
Date:   Fri,   Nov 12 2004 7:39 pm
From: VideoProcessor <[EMAIL PROTECTED]> 

"Andrei Kouznetsov" <[EMAIL PROTECTED]> wrote in news:cn2o39$jrp$1
@online.de:

>> Beacause I can't access the code ... ;-)
>> It's the visual component of a jmf video player and I have to mark some
>> regions in it.
>> Maybe any other idea for doing this?
> 
> put your video player into some component with glassPane (JFrame for
> example) and paint whatever you need on glassPane.
> 

I tried to, but it seems as if the glassPane is still under the visual 
component of the player.



== 2 of 3 ==
Date:   Fri,   Nov 12 2004 11:47 pm
From: "Andrei Kouznetsov" <[EMAIL PROTECTED]> 

> I tried to, but it seems as if the glassPane is still under the visual
> component of the player.

this say us that the player is a heavyweight component!
and you have a big problem.

However I yet don't understand why you cant extend your player and write
something like this:
class MyPlayer extends VideoPlayer {

public void paint(Graphics g) {
    super.paint(g);
    //draw here whatever you want
}

If player is final class then use reflection to make it not final and
create/compile MyPlayer on the fly at run time.

-- 
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities






== 3 of 3 ==
Date:   Fri,   Nov 12 2004 11:50 pm
From: "Andrei Kouznetsov" <[EMAIL PROTECTED]> 

> > put your video player into some component with glassPane (JFrame for
> > example) and paint whatever you need on glassPane.
> >
>
> I tried to, but it seems as if the glassPane is still under the visual
> component of the player.

dont use glassPane, use one Component for every your drawing and place it
over your player!


-- 
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities






==========================================================================
TOPIC: port number for web applications in jboss
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79a48673850acf8f
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 8:41 pm
From: Sudsy <[EMAIL PROTECTED]> 

Matt wrote:
> After we deploy the web applications in deploy directory C:\jboss\deploy,
> what's the port number when we run the web application in web browser?
> I tried 8080 but not working.
> 
> Please advise. Thanks

You've posted four different questions to this newsgroup in rapid
succession, questions which underscore your lack of familiarity with
certain basic concepts.
Suggestion? RTFM!
JBoss does come with documentation files, wouldn't you know. And all
your other questions could be answered by referring to the appropriate
sources.
Finally, consider posting "newbie" questions to comp.lang.java.help.
Your e-mail address gives me pause, however. Are you representing
yourself as an expert in Java refactoring?

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: Memory sensitive caches
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/847960ed2b3fe4f4
==========================================================================

== 1 of 2 ==
Date:   Fri,   Nov 12 2004 8:59 pm
From: [EMAIL PROTECTED] (Mark McKay) 

I have a large number of objects I load from disk and cache in a
HashMap.  I'd like to know if the JVM is about to run out of memory,
and if so to then clear the eldest entries out of this cache.  That
is, I'd like to be notified that an OutOfMemory error is about to be
thrown, and add some custom handling to try and free up space to
prevent it.

I've tried doing this with SoftReferences, but they're being cleared
long before I run out of memory.

Is there any way to implement a memory sensitive cache?

Mark McKay



== 2 of 2 ==
Date:   Sat,   Nov 13 2004 12:34 am
From: "Mike Schilling" <[EMAIL PROTECTED]> 


"Mark McKay" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I have a large number of objects I load from disk and cache in a
> HashMap.  I'd like to know if the JVM is about to run out of memory,
> and if so to then clear the eldest entries out of this cache.  That
> is, I'd like to be notified that an OutOfMemory error is about to be
> thrown, and add some custom handling to try and free up space to
> prevent it.
>
> I've tried doing this with SoftReferences, but they're being cleared
> long before I run out of memory.
>
> Is there any way to implement a memory sensitive cache?

No; the information you need just isn't there.  What I've done in similar 
situations is build a mostly Soft-Reference-based cache in which the last N 
objects referenced are also held in memory by hard references.  It's not 
ideal, because there is a risk of running out of memory if N is too large, 
but with some tuning it can work quite well. 






==========================================================================
TOPIC: Question about passing values?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fe1c15e0fc2a949
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 9:58 pm
From: Thomas Schodt <[EMAIL PROTECTED]> 

Ken Adams wrote:

> int tester =0;
> 
> foo(tester);
> 
> foo(int value)
> {
>     in here, is there any way to get the string value "tester" from the 
> value reference?
> }

int tester = 0;

foo("tester",tester);

foo(String name,int value) {
     // a way to get the string value "tester" from the caller
}

o_O




==========================================================================
TOPIC: Tool for sharing C data-structures with Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bf1b9c3fa7ec6f0b
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 10:03 pm
From: Thomas Schodt <[EMAIL PROTECTED]> 

Rick Giuly wrote:
> I'm thinking about making a program in java that will allow you to use
> C data-structures (probably read from a network) easily

<http://jade.dautelle.com/api/jade/util/Struct.html>




==========================================================================
TOPIC: looking for high-level web development tools
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b726dc72d5129bda
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 10:37 pm
From: [EMAIL PROTECTED] (unixhack.blogspot.com) 

Hello,

Does anybody know of a tool that can help me be more
productive when creating a web-based interface? I am
currently using JSP and servlets, and it seems to me
that I'm writing a lot of redundant stuff. I suspect
that I'm not enough of an Objects guru, but that is
probably best left for another post :-)

Problem description:
I need to implement a rather complicated web interface
to replace a data gathering tool currently semi-implemented
on Excel-VBscript (or so they tell me, I'm totally useless
when it comes to Microsoft development tools). The tool
is like a very complicated wizard with lots of steps,
and the UI that appears at the nth step will depend on
what the user entered at steps 1... n-1.

Finally, I want to be able to send the end results to a
database.

I looked at Struts/Tiles some time ago, but it seemes that
to use them you have to already be a JSP/servlets ultra-expert,
which I'm not quite. (At least that was the case with
all the documentation and books I found/bought -- if there
is a more newbie-oriented website or book please let me
know).

Also looked at IBM's WebSphere product, but
it seems a little overkill for what I'm trying to do.

So, what other tools are available for creating complicated
web interfaces?

(Note that I'm not talking about the HTML part -- I'm quite
happy with writing the HTML on "vi" myself. What I need is to
be able to manage the link between web forms/servlets/database
more efficiently.)

Well, I hope this all makes some sense. Thanks for having read
this far and thanks in advance for any help,

Ernesto




==========================================================================
TOPIC: .exe Launched Java App -- How's It Working?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5fd9b8a5d2a9b437
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 11:00 pm
From: cppaddict <[EMAIL PROTECTED]> 

I have program (made with exe4j) that uses an .exe file to launch a
Java application.  That is, the application is contained in .jar
files, and the .exe file issues the command that starts the app.
Something like:

java -jar TheJarFile.jar command line args

I would like to know exactly which command the .exe file is issuing to
start the application.  That is, what the command line args or other
options are.

TIA,
cpp




==========================================================================
TOPIC: Need as much help as possible
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c8e64b34d7154d8
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 12 2004 11:36 pm
From: Rob <[EMAIL PROTECTED]> 

Thomas G. Marshall wrote:
> Rob coughed up:
> 
>>dar7yl wrote:
>>
>>>"Collin" <[EMAIL PROTECTED]> wrote in message
>>>news:[EMAIL PROTECTED]
>>>
>>>
>>>>Ann wrote:
>>>>
>>>>
>>>>>"WCU_Student3456" <[EMAIL PROTECTED]> wrote in message
>>>>>
> 
> news:[EMAIL PROTECTED]
> 
>>>>>
>>>>>>hey i'm new to the java scene and i have a major assignment due
>>>>>>for class on the 12th of nov.  I need help with a program that
>>>>>>has a point class...a
>>>>>>driver and a circle class. the program is suppost to display info
>>>>>>about
>>>>>
>>>>>the
>>>>>
>>>>>
>>>>>
>>>>>>circle...if anyone is interested or has pitty...college students
>>>>>>love pitty..please respond and i will try to send the assignment
>>>>>>to you...i have it scanned on adobe...
>>>>>>
>>>>>>thanks ever so much
>>>>>
>>>>>
>>>>>Why not outsource it to another country, grab a phone book. You can
>>>>>probably get all your course work done there not just java.
>>>>>
>>>>>
>>>>
>>>>I'll do it for 50,000 USD; that's dicounted for first-timers.
>>>>
>>>
>>>
>>>I'll do it for $50,000 CDN dollars.
>>>
>>>
>>
>>I'll do it for a bottle of vodka.
>>That, or $25 CDN.
> 
> 
> Vodka?  Real engineers are powered by Diet Coke.
> 
> By the freaking gallon....
> 
> 
Sorry, I'm Polish. :D




==========================================================================
TOPIC: Writting data to a SocketChannel using NIO
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/73de6bca3d676791
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 13 2004 12:19 am
From: [EMAIL PROTECTED] (Fritz Bayer) 

Esmond Pitt <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> The best way is to assume that you can write until you get a return 
> value of zero from the write call. When this happens on a channel you 
> should register the channel for OP_WRITE. Whenever you succeed in 
> writing all the data you asked to write, you should deregister for OP_WRITE.
> 
> EJP

That's excatly what I figured. What do you think about testing
isWriteable() in the SelectionKey at that point?

Of course the state is lilkely to be obsolete unless the channels was
not writeable at the time, when last selection via select() took
place.




==========================================================================
TOPIC: Is session id machine independent and unique?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/94c349e02b2efcb4
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 13 2004 12:36 am
From: "Andy Flowers" <[EMAIL PROTECTED]> 

The format of a Session Id is AFAIK unique to each and every vendor.

Session Ids have the possibility to be reused though. If the session on 
machine A times out then that id could be regenerated for machine B. One 
this that should be true, however, is that not 2 distinct sessions, whether 
from different browser sessions on a single machine or different machines, 
should have the same session Id at the same point in time.

To get a handle on how it 'could' be implemented why not take a look at the 
Tomcat source code/documentation and havea look at how it handles sessions ? 
http://jakarta.apache.org/tomcat/index.html 





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

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