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

Today's topics:

* java for system level code - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9b6c7337f828b313
* jsp script timeout - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23c40ebe6db1aef3
* Annotation of enum members (JDK 1.5) - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8d424376a1ff858c
* Socket: Input/OutputStream - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/54e7f133683aa17d
* Socket Input-/Outputstream - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ce6e806374050fab
* 'The page cannot be displayed' error when using IE's Back button... - 2 
messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eab0adcf08081f30
* converting an existing Swing application to client server - 3 messages, 3 
authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/31d2080f8f3e59a4
* Packing JRE - 3 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1a5c7579f5f09e2
* wondering how i can launch tomcat from ant without ant hanging... - 1 
messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f54a5a6d89ab36e8
* about the joesnmp - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96314fc2db006ca7
* Thread and Listener - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79e41b9865d2cf15
* Website for J2ME-aware hardware - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/97590ce422d382f9
* please I need help on my java Applet - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b9a589a8cfda9bef
* DOM extension of JTree - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/90a26f0e09247454
* Good JSP 2.0 Book? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23bfc11924c6feb3
* cluster versus load balancing - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f73b032b5044c21f

==============================================================================
TOPIC: java for system level code
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9b6c7337f828b313
==============================================================================

== 1 of 2 ==
Date: Wed, Dec 22 2004 12:59 pm
From: "GregSmith"  

imho, you may want to think about jme. it is used to run cell phones
and handhelds. it still uses a jvm, but that *is* the OS. but if you
are talking about pc-based systems, then no, you wont be able to create
bootable programs - easily. you might create a bootstrap program that
loads the jvm and then runs your java program, however.




== 2 of 2 ==
Date: Wed, Dec 22 2004 1:07 pm
From: "Robert kebernet Cooper"  


[EMAIL PROTECTED] wrote:
> as all JAVA programs need JAVA virtual machine to run, which in turn
> needs an operating system to run, can JAVA be used to write bootable
> programs, or JAVA? if yes, how?

I would imagine you could use GCJ to write bootable programs assuming
you had the hardware to support the libgjc codebase and provide all the
support services.





==============================================================================
TOPIC: jsp script timeout
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23c40ebe6db1aef3
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 1:27 pm
From: "GregSmith"  

i have seen this as well. check the server (tomcat, etc...) for file
upload limitations.





==============================================================================
TOPIC: Annotation of enum members (JDK 1.5)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8d424376a1ff858c
==============================================================================

== 1 of 2 ==
Date: Wed, Dec 22 2004 10:39 pm
From: Emmeran Seehuber  

Hi,

is it possible to annotate members of enums? It doesn't seem so -- at least
I can't get the values at runtime :(

This is my annotation class:

@Retention(RetentionPolicy.RUNTIME)
public @interface BCComment {
 String value();
}

And this is the class containing the enum:

public class ByteCodeCommands {
 public enum ByteCode {
  @BCComment("Anfang einer Methode")
  METHODPROLOG,
  @BCComment("Focus auf die Instance-Variablen")
  FOCUSSELFVARIABLES,
  // ...
 }

 public static void main(String[] args) throws IOException {  
  // ...
  for (ByteCode code : ByteCode.values()) {
   Annotation[] annotations = ByteCode.class.getAnnotations();
   Annotation[] annos = code.getClass().getAnnotations();
   System.out.println(annotations.length);
   System.out.println(annos.length);
   BCComment comment = code.getClass().getAnnotation(BCComment.class);
   System.out.println(comment);
  }
  // ...
  }
}


When running this program it prints:
0
0
null

What is wrong with my code? Is it not possible to annotate enum members?

Thanks.

cu,
  Emmy



== 2 of 2 ==
Date: Wed, Dec 22 2004 10:17 pm
From: "Tony Morris"  

"Emmeran Seehuber" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> is it possible to annotate members of enums? It doesn't seem so -- at
least
> I can't get the values at runtime :(
>
> This is my annotation class:
>
> @Retention(RetentionPolicy.RUNTIME)
> public @interface BCComment {
>  String value();
> }
>
> And this is the class containing the enum:
>
> public class ByteCodeCommands {
>  public enum ByteCode {
>   @BCComment("Anfang einer Methode")
>   METHODPROLOG,
>   @BCComment("Focus auf die Instance-Variablen")
>   FOCUSSELFVARIABLES,
>   // ...
>  }
>
>  public static void main(String[] args) throws IOException {
>   // ...
>   for (ByteCode code : ByteCode.values()) {
>    Annotation[] annotations = ByteCode.class.getAnnotations();
>    Annotation[] annos = code.getClass().getAnnotations();
>    System.out.println(annotations.length);
>    System.out.println(annos.length);
>    BCComment comment = code.getClass().getAnnotation(BCComment.class);
>    System.out.println(comment);
>   }
>   // ...
>   }
> }
>
>
> When running this program it prints:
> 0
> 0
> null
>
> What is wrong with my code? Is it not possible to annotate enum members?
>
> Thanks.
>
> cu,
>   Emmy


You are attempting to get the annotation from the class when it appears on
the fields (not the class).
This is perhaps your intention:

  for (Field f : ByteCode.class.getFields()) {
   Annotation[] annotations = f.getAnnotations();
   System.out.println(annotations.length);
   BCComment comment = f.getAnnotation(BCComment.class);
   System.out.println(comment);
  }

Also, take a look at java.lang.annotation.Target to restrict the constructs
that a particular annotation can appear on.

-- 
Tony Morris
http://xdweb.net/~dibblego/







==============================================================================
TOPIC: Socket: Input/OutputStream
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/54e7f133683aa17d
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 11:03 pm
From: "puretec"  

I have the following problem:

a java application (client) should communicate with a sever, where the 
communication objects are as follows:

public class Comm_1
{
long lSync;
long lLength;
CData_1 oData1;
}

....

public class Comm_1
{
long lSync;
long lLength; // length [byte] of the object
CData_n oDatan;
}

1) How can I determine the length of an object in order to assign that value 
to o.lLength (I know how to do this by hand);

2) Is the ObjectOutputStream ( linked to the socket.getOutputStream() ) the 
stream which I should use for sending the objects?

sincerely
thomas







==============================================================================
TOPIC: Socket Input-/Outputstream
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ce6e806374050fab
==============================================================================

== 1 of 3 ==
Date: Wed, Dec 22 2004 11:09 pm
From: "Thomas"  

I have the following problem:


a java application (client) should communicate with a sever, where the

communication objects are as follows:


public class Comm_1

{

long lSync;

long lLength;

CData_1 oData1;

}


....


public class Comm_1

{

long lSync;

long lLength; // length [byte] of the object

CData_n oDatan;

}


1) How can I determine the length of an object in order to assign that value

to o.lLength (I know how to do this by hand);


2) Is the ObjectOutputStream ( linked to the socket.getOutputStream() ) the

stream which I should use for sending the objects?


sincerely

thomas







== 2 of 3 ==
Date: Wed, Dec 22 2004 11:26 pm
From: ByteCoder  

Thomas wrote:
> I have the following problem:
> 
> 
> a java application (client) should communicate with a sever, where the
> 
> communication objects are as follows:
> 
> 
> public class Comm_1
> 
> {
> 
> long lSync;
> 
> long lLength;
> 
> CData_1 oData1;
> 
> }
> 
> 
> ....
> 
> 
> public class Comm_1
> 
> {
> 
> long lSync;
> 
> long lLength; // length [byte] of the object
> 
> CData_n oDatan;
> 
> }
> 
> 
> 1) How can I determine the length of an object in order to assign that value
> 
> to o.lLength (I know how to do this by hand);

Object.length, Object.get...()? Could be anything. A proper IDE has code 
completion. I think that is very helpful for these kind of questions.

> 2) Is the ObjectOutputStream ( linked to the socket.getOutputStream() ) the
> 
> stream which I should use for sending the objects?

I'd say so.

Good luck!

-- 
-------------
- ByteCoder -           ...I see stupid people
-------------
                    Curiosity *Skilled* the cat



== 3 of 3 ==
Date: Wed, Dec 22 2004 6:18 pm
From: "Ryan Stewart"  

"Thomas" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> 1) How can I determine the length of an object in order to assign that 
> value
> to o.lLength (I know how to do this by hand);
>
You do? How exactly is that? There's no guarantee what size an object will 
be, especially across different platforms. 






==============================================================================
TOPIC: 'The page cannot be displayed' error when using IE's Back button...
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eab0adcf08081f30
==============================================================================

== 1 of 2 ==
Date: Wed, Dec 22 2004 2:18 pm
From: [EMAIL PROTECTED] 

The real error, as stated at the end of IE's error page, is 'Cannot
find server or DNS Error'.  It seems like this is an IE bug(s), but I
would like to fix and haven't been able to.

I'm using a struts/Tomcat-based app.  I have Windows XP Professional
with IE 6.x with XP Service Pack 2 installed.  I'm testing and getting
this error against both a localhost-based app and the same app deployed
remotely.

Any clues?  Neither Firefox nor Opera exhibit this behavior.  Any
ideas?

Wish I could just forget about IE, but no such luck.  It's not just my
machine - it's all developers at my company.  I'll try to reproduce
from outside of work with XP Home, but not hopeful.

I've tried using both 'localhost' and '127.0.0.1'.  Is there anything I
haven't tried yet?

I know IE sucks, but a non-functioning Back button?  C'mon.  And I feel
the error has to have something to do with my app/struts/expires-type
headers/etc - something.  I actually haven't been able to verify if my
app/Tomcat is sending out 'expires' and 'cache' headers of different
types - I don't think so, based on the code, but at least my logon page
is throwing out the following headers:

Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT

I think these are from Tomcat, but not sure why they're being issues,
and not sure if they're the cause of my problems.




== 2 of 2 ==
Date: Wed, Dec 22 2004 2:28 pm
From: "Robert kebernet Cooper"  

Start by going into your IE options and turning off "Friendly Error
Messages".





==============================================================================
TOPIC: converting an existing Swing application to client server
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/31d2080f8f3e59a4
==============================================================================

== 1 of 3 ==
Date: Wed, Dec 22 2004 3:43 pm
From: [EMAIL PROTECTED] 

Greetings,

I have a Swing application that manages local devices using SNMP, and
I'm looking for a simple way to convert it to run as client server. my
dream is to find something that will wrap the current application,
allow it to run locally and the GUI will work from a remote site.
Can anybody refer me to such tool?

TIA,
Zeev




== 2 of 3 ==
Date: Thurs, Dec 23 2004 1:54 am
From: "Michiel Konstapel"  

> I have a Swing application that manages local devices using SNMP, and
> I'm looking for a simple way to convert it to run as client server. my
> dream is to find something that will wrap the current application,
> allow it to run locally and the GUI will work from a remote site.
> Can anybody refer me to such tool?


... X Windows?
Michiel



== 3 of 3 ==
Date: Wed, Dec 22 2004 6:06 pm
From: [EMAIL PROTECTED] 

Make it an applet class to access it from a web page via web browser or
appviwew





==============================================================================
TOPIC: Packing JRE
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1a5c7579f5f09e2
==============================================================================

== 1 of 3 ==
Date: Wed, Dec 22 2004 11:45 pm
From: Andrew Thompson  

On Wed, 22 Dec 2004 11:55:33 -0800, Steve Sobol wrote:

> Andrew Thompson wrote:
...
> "I imagine the .NET IDE would
> also have a D'n'D GUI editor, which would also speed development
> over the general Java approach of hand coding the GUI."
> 
> I use Eclipse and Jigloo and see the same benefits. People running NetBeans 
> can 
> also use DnD.

Using what Layouts though?  AbsoluteLayout?  XYLayout?

It brings us to the  basic problem that when you shift the 
application from the development machine to a machine with a 
different RE, fonts, screen size, PLAF, the UI breaks.

If you use a D'n'D GUI designer (using PutItHere layouts) you 
effectively lose the X-plat GUI in any case.

> "It would be much easier in .NET to display/edit common MS
> document formats such as .doc, .xls, to get the 'OS Component',
> and actively control it."
> 
> I doubt it. Maybe a little easier. You can embed ActiveX objects in a Java 
> app 
> running on Windows, can't you? (I could be wrong about this; have never tried 
> it)

? News to me.  I have no need to get that intimate with Windows.
..
>> How many Win users do you think *I think* have Java?
> 
> You said "many". 

Of course, when I said 'many', I meant 'many, plus or minus 25%'.   ;-)

>..I'm saying "still relatively few", 

+ or -..?

>...and I apologize, 

It's cool.

>..that 
> should have been a completely separate statement as it was not directly 
> relevant to my comment about your reply being silly.

It did read rather oddly.  

-- 
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: Wed, Dec 22 2004 6:00 pm
From: Steve Sobol  

Andrew Thompson wrote:
> Using what Layouts though?  AbsoluteLayout?  XYLayout?

I used to use AbsoluteLayout, then I got smart; now I use GridLayout and 
FormLayout (FormLayout may be an SWT-specific thing).


> Of course, when I said 'many', I meant 'many, plus or minus 25%'.   ;-)
> 
>>..I'm saying "still relatively few", 
> 
> + or -..?

Oh, I don't know, 100%? (*pained expression*)

Winbloats PCs don't ship with the J2 RE yet. When that starts happening,* I'm 
sure the number will increase significantly.

Cheers...


*insert obligatory "yeah, right" here, followed by standard rant about 
anticompetitive Microsoft bulls^H^H^H^H^Hcompany policies.


-- 
JustThe.net Internet & New Media Services, http://JustThe.net/
Steven J. Sobol, Geek In Charge / 888.480.4NET (4638) / [EMAIL PROTECTED]
PGP Key available from your friendly local key server (0xE3AE35ED)
Apple Valley, California     Nothing scares me anymore. I have three kids.



== 3 of 3 ==
Date: Thurs, Dec 23 2004 2:52 am
From: Andrew Thompson  

On Wed, 22 Dec 2004 18:00:07 -0800, Steve Sobol wrote:

> Winbloats PCs don't ship with the J2 RE yet. When that starts happening,...

I vote 'not ever'.  Java is a plug-in that needs to be kept up to date.  
Install an OS/browser bare and get Java from the manufacturer.
<http://www.physci.org/codes/java/plugin.jsp>

It's up to you, me and other Java developers to convince users
of the need for the Java plug-in, by producing all those wonderful 
apps. that have the 'Requires the free Java Plug-In' message below 
the glossy picture.

-- 
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: wondering how i can launch tomcat from ant without ant hanging...
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f54a5a6d89ab36e8
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 4:41 pm
From: [EMAIL PROTECTED] 

i fixed this same problem by adding spawn="true" to the exec element. i
know this works with with ant 1.6 and above.

Chris Bedford wrote:
> response to [EMAIL PROTECTED]
>
> thanks for your post !    I tried the same thing and it does not work
> for me.
> I'm running ant on windows 2k, if that makes any difference...
>
> Here's what i tried, verbatim,  this launches tomcat, then ant waits
> forever:
>
>  <target name="box" >
>         <exec
>             dir="d:/temp/TOMCAT/jakarta-tomcat-4.1.24/bin/"
>
executable="d:/temp/TOMCAT/jakarta-tomcat-4.1.24/bin/startup.bat">
>         </exec>
>     </target
>
>
> HOWEVER, I can actually suggest a solution at this point.  It's
> complicated, but it worked for me.
>
> step 1) Download Bill Burton's scripts for launching ant in the
> background.
>    details:
>
http://www.mail-archive.com/[email protected]/msg23641.html
>
> step 2)
>
> add this target to Bill's script  (you will want to change the path
> names
>  to point to where your tomcat actually lives):
>
>  <target name="exec_tomcat"
>         description="Asynchronous Exec in a New Window">
>     <exec executable="${antRunAsync}"
>         dir="d:/temp/TOMCAT/jakarta-tomcat-4.1.24/bin/"
>         vmlauncher="false"
>           failonerror="true">
>       <env key="ANTRUN_TITLE" value="${exec_title}" />
>       <arg
line="d:/temp/TOMCAT/jakarta-tomcat-4.1.24/bin/startup.bat"
> />
>     </exec>
>     <sleep seconds="2" />
>     <echo message="leaving target" />
>   </target>
> 
> 
> Many thanks to Bill !    he rocks.





==============================================================================
TOPIC: about the joesnmp
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96314fc2db006ca7
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 23 2004 2:17 am
From: "celeste zhu via JavaKB.com"  

could the joesnmp provide the setting  function like "snmpset of net-snmp"?
i study the test sample in opennms: snmpwalk.java

i guess if i want to set new value to some OID, the following code is enough:

                SnmpVarBind[]  vblist = { new SnmpVarBind(walker.m_startOid),1 
};
                SnmpPduRequest pdu = new SnmpPduRequest(SnmpPduPacket.SET, 
vblist);

or i should change "1" to some handler of "org.opennms.protocols.snmp.SnmpInt32"

right?!

-- 
Message posted via http://www.javakb.com




==============================================================================
TOPIC: Thread and Listener
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79e41b9865d2cf15
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 23 2004 2:18 am
From: "celeste zhu via JavaKB.com"  

could the joesnmp provide the setting  function like "snmpset of net-snmp"?
i study the test sample in opennms: snmpwalk.java

i guess if i want to set new value to some OID, the following code is enough:

        SnmpVarBind[]  vblist = { new SnmpVarBind(walker.m_startOid),1 };
        SnmpPduRequest pdu = new SnmpPduRequest(SnmpPduPacket.SET, vblist);

or i should change "1" to some handler of "org.opennms.protocols.snmp.SnmpInt32"

right?!

-- 
Message posted via http://www.javakb.com




==============================================================================
TOPIC: Website for J2ME-aware hardware
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/97590ce422d382f9
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 6:25 pm
From: [EMAIL PROTECTED] (Eli) 

Hi all,
I've been thinking lately in buying a J2ME aware mobile phone. After a
basic search, I failed to find a website that shows some sort of
listing of all J2ME-aware hardware (mobile phones, PDAs, ...).
Do you know of such a website?
Cheers,

Eli




==============================================================================
TOPIC: please I need help on my java Applet
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b9a589a8cfda9bef
==============================================================================

== 1 of 1 ==
Date: Thurs, Dec 23 2004 2:36 am
From: "Ann"  

and a credit card

"Andrew Thompson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wed, 22 Dec 2004 07:08:52 -0500, java10 wrote:
>
> > //i will be grateful if someone can rewrite this code for me,
>
> And anybody that chooses to help you would probably be grateful
> if you posted an SSCCE[1].
>
> After fixing the wrapped line, the misplaced closing comment
> tag and the tab spacing, I discovered your code has 21 compilation
> errors, including the lack of Payment and Product classes.
>
> Please post an SSCCE in future.
>
> [1] <http://www.physci.org/codes/sscce.jsp>
>
> --
> 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: DOM extension of JTree
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/90a26f0e09247454
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 6:56 pm
From: "Arun"  

Hi,

I've created the following extension of a JTree.
However when I try to create an instance of it, it doesnt work.
Instead the tree just contains the default "colors, sports, foods"
nodes.

The class takes as an input a DOM and should process this DOM into the
JTree. I kinda know some parts work, like addChildNodes class, because
i did a system output and it outputted all the nodes in the xml file i
inputed (which was converted to a dom first).

Could someone please help me?

The dom processing is done with JDOM.
I create an instance of the Tree like so:
JTree tree = new XMLTree(xmlDOM);


This is the class:

******************************************************************

import java.util.List;

import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;

import org.jdom.Document;
import org.jdom.Element;


public class XMLTree extends JTree{

public XMLTree(Document doc)
{
makeRootNode(doc);
}


private static DefaultMutableTreeNode makeRootNode(Document xmlDom)

{
// Recursively descends the tree and copies corresponding
// dom nodes.
try{
Element rootElement = xmlDom.getRootElement();
DefaultMutableTreeNode rootNode = buildTree(rootElement);
return(rootNode);
}
catch(Exception e) {
// Returns error message if building of tree is not successful
String errorMessage = "Error making root node: " + e;
System.err.println(errorMessage);
e.printStackTrace();
return(new DefaultMutableTreeNode(errorMessage));
}
}

private static DefaultMutableTreeNode buildTree(Element
rootElement)
{
// Makes a JTree node for the root, then makes JTree
// nodes for each child and adds them to the root node.
DefaultMutableTreeNode rootNode = new
DefaultMutableTreeNode(rootElement.getName());
addChildNodes(rootNode,rootElement);
return(rootNode);
}

private static void addChildNodes(DefaultMutableTreeNode
parentNode, Element parentElement)
{
// Creates list of all children of current parent element
List allChildren = parentElement.getChildren();
// Checks to see the element has any children
if (allChildren.size() != 0)
{
for( int x = 0; x < allChildren.size(); x++)
{
// Creates a new element from current element in list
Element childElement = (Element)allChildren.get(x);
// Converts this element into a node
DefaultMutableTreeNode childNode = new
DefaultMutableTreeNode(childElement.getName());
// Adds this node to the current parent node
parentNode.add(childNode);
// Checks to see if this child node has a child node of
itself.
// If so, then adds child node to that. Recursive procedure.
addChildNodes(childNode, childElement);
}
                }
    }
    
    
    
    
}





==============================================================================
TOPIC: Good JSP 2.0 Book?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23bfc11924c6feb3
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 6:58 pm
From: [EMAIL PROTECTED] 

Hi,

A good book, but "Advanced JavaServer Pages" specializes in
pre-JSTL/JSP2 'custom tags'.

I've read all of the these and more but if you only want one book then
go with the one most readable to you.

For general JSP books look at:-

1. "Web Development with Java Server Pages" 2nd edition
Duane K. Fields, Mark A. Kolb

Not always easy to read but a thorough and useful book.

Only JSP 1.2 but add JSTL knowledge and you'll know JSP 2.


2. "Servlets and JSP: The J2EE Web Tier"
Jayson Falkner, Kevin R Jones

Easier to read than most, not so dry and reference-ish, a very good
book.


3. The O'Reilly's JSP book. 3rd edition
Hans Bergsten.

More reference-ish but good.


4. Marty Hall's books:-
"Core Servlets and JavaServer Pages". 1st edition. JSP 1.1 Available
for free at his site.
'More Servlets ..." Covers JSP 1.2
"Core Servlets and JavaServer Pages". 2nd edition. JSP 2

Good books, this series covers the API's better than most but the
sample apps are very lame!


Cheers,
Alex Kay.





==============================================================================
TOPIC: cluster versus load balancing
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f73b032b5044c21f
==============================================================================

== 1 of 1 ==
Date: Wed, Dec 22 2004 7:12 pm
From: [EMAIL PROTECTED] 

Clustering is one technique used to achieve scalable load balancing.
There are other ways to do load balancing.

Not all J2EE applications can be clustered because of the way they are
written.
Not all J2EE servers can cluster.

Only sites with very heavy traffic require load balancing most don't
need it.

Cheers,
Alex Kay




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

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

To post to this group, send email to [EMAIL PROTECTED] or
visit http://groups-beta.google.com/group/comp.lang.java.programmer

To unsubscribe from this group, send email to
[EMAIL PROTECTED]

To change the way you get mail from this group, visit:
http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

To report abuse, send email explaining the problem to [EMAIL PROTECTED]

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

Reply via email to