comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * struts: question regarding dispatchaction - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38793b73ceb5ac31 * stack implementation - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c909f1ce5b4696a * where J2EE RI download? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8bfc342d36cd88c * How to starthandshake with client browser?? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d41b9d8f6879f8b * JSP Struts <logic:equal> tag questions - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/135efce4ed8c9cd * tomcat 4.1.30 and not recognizing new compiled code - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d037203a155ce61f * Turn off boundary checks? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fc5b4ab5a504cf9 * Need help with VE of eclipse - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b9e183ba8f8af2a * Problem with Struts 1.1 and select box - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f2609668a5d78566 * why does ObjectInputStream constructor block reading a header - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7b8520ff9f293b96 * What is Instance Initializer? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/15dac666512492d6 * How to create a JAR file - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ea455ce0dfc0c521 * Stupid null pointer exception - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aeeebd0bb6f11be3 * how do avoid passivate (about ejb)? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/796393a8f9a7e582 * Off Topic: Safari Bookshelf - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3d4c237d0e60a7ee ========================================================================== TOPIC: struts: question regarding dispatchaction http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38793b73ceb5ac31 ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 3:52 pm From: "Murray" <[EMAIL PROTECTED]> "Dan Hicks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I'm implementing dispatchaction so I can include multiple actions in > one class. However, is there a way to set up a default for whatever > handler parameter I decide to use? For instance, can I tell it to go > to setup action if no action is specified? Have you looked at the API documentation? DispatchAction#unspecified() == 2 of 2 == Date: Sun, Oct 31 2004 5:40 pm From: "Martin Froment" <[EMAIL PROTECTED]> There is a part of the implementation of execute method from DispatchAction class. If your mapping parameter is null, you will have a ServletException. You can redifine the DispatchAction for your needs affecting your default method name to the automatic variable named parameter. Maybe cleaner to override that method in a BaseAction class of your own project... // Identify the request parameter containing the method name String parameter = mapping.getParameter(); if (parameter == null) { String message = messages.getMessage("dispatch.handler", mapping.getPath()); log.error(message); throw new ServletException(message); } "Dan Hicks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I'm implementing dispatchaction so I can include multiple actions in > one class. However, is there a way to set up a default for whatever > handler parameter I decide to use? For instance, can I tell it to go > to setup action if no action is specified? ========================================================================== TOPIC: stack implementation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c909f1ce5b4696a ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 4:06 pm From: "Boudewijn Dijkstra" <[EMAIL PROTECTED]> "Skip" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > "Boudewijn Dijkstra" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Tor Iver Wilhelmsen" <[EMAIL PROTECTED]> schreef in > bericht >> > >> > Note that this also means that you can call Vector's very non- >> > stacky operations on a Stack, e.g. insert and remove elements >> > anywhere, sort it, etc. Ideally I would write my own implementation >> > using a LinkedList as an internal representation. >> >> Something like this perhaps? > > <snip> > > What about a backing-array implementation, shifting a 'pointer'... > that would be way faster than linking. You could resize the backing- > array ofcourse, if it's too small or too large: > > <snip> Tor said he wanted a linked list. And your example would probably be more efficient with a backing ArrayList. == 2 of 2 == Date: Sun, Oct 31 2004 5:38 pm From: Kenneth Stokes <[EMAIL PROTECTED]> Boudewijn Dijkstra wrote: > "Tor Iver Wilhelmsen" <[EMAIL PROTECTED]> schreef in bericht > news:[EMAIL PROTECTED] > >>Sudsy <[EMAIL PROTECTED]> writes: >> >> >>>"The Stack class represents a last-in-first-out (LIFO) stack of objects. It >>>extends class Vector with five operations that allow a vector to be treated >>>as a stack. >> >>Note that this also means that you can call Vector's very non-stacky >>operations on a Stack, e.g. insert and remove elements anywhere, sort >>it, etc. Ideally I would write my own implementation using a >>LinkedList as an internal representation. > > > Something like this perhaps? > > > /** > * An object type stack implemented in a double-linked list. > * Legacy algorithms were used. > */ > public class LinkedStack > { > /** The bottom of the stack, and head of the list. */ > protected Node head; > > /** The top of the stack, and tail of the list. */ > protected Node tail; > > /** The size of the stack. */ > protected int size; > > > /** Creates an empty stack. */ > public LinkedStack() { > clear(); > } > > /** Clears the stack. */ > public void clear() > { > head = null; > tail = null; > size = 0; > } > > > /** Pushes the specified object onto the top of the stack. */ > public void push(Object obj) > { > Node n = new Node(obj); > if (isEmpty()) > head = n; > else > tail.next = n; > n.prev = tail; > tail = n; > size++; > } > > /** Pops an element from the top of the stack and returns it. */ > public Object pop() > { > if (tail == null) > return null; > Node removeItem = tail; > if (head == tail) //only zero or one item left to pop > clear(); > else { > tail = tail.prev; > tail.next = null; > } > size--; > return removeItem.content; > } > > /** Returns the top element without popping it. */ > public Object top() { > return tail.content; > } > > > /** Returns whether the stack is empty. */ > public boolean isEmpty() { > return size == 0; > } > > public int size() { > return size; > } > > > /** Represents the list node for holding stack element references. */ > protected static class Node > { > /** A reference to the previous node in the list. */ > protected Node prev; > > /** A reference to the contents of this node. */ > protected Object content; > > /** A reference to the next node in the list. */ > protected Node next; > > /** Creates an unlinked node. */ > protected Node(Object content) > { > prev = null; > this.content = content; > next = null; > } > } > } > > > Warning: the previous version worked perfectly, but I don't know about this > one. I didn't change much though. ;-) > > Thanks Boudewijn, that cleared it up for me. ========================================================================== TOPIC: where J2EE RI download? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8bfc342d36cd88c ========================================================================== == 1 of 1 == Date: Sun, Oct 31 2004 4:47 pm From: "Íõ" <[EMAIL PROTECTED]> where J2EE RI download? ========================================================================== TOPIC: How to starthandshake with client browser?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d41b9d8f6879f8b ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 5:23 pm From: [EMAIL PROTECTED] (Jakekeke) Thank Bruno That is what i want to know. However, i am still confuse on that problem. After i get the CONNECT request what should i sent back to the browser? 200 message?? And then what should i do to handshake with browser? ie, how to let the browser to trust my certificate I know how to make a plaintext connection, however, i should finish handshake first, right? which is the problem i didn't solve yet. Would anyone can help me? Thanks. == 2 of 2 == Date: Mon, Nov 1 2004 12:31 am From: Rogan Dawes <[EMAIL PROTECTED]> Jakekeke wrote: > Thank Bruno > That is what i want to know. > However, i am still confuse on that problem. > > After i get the CONNECT request > what should i sent back to the browser? 200 message?? > And then what should i do to handshake with browser? > ie, how to let the browser to trust my certificate > > I know how to make a plaintext connection, > however, i should finish handshake first, right? > which is the problem i didn't solve yet. > > Would anyone can help me? > Thanks. Please see my other post in this thread pointing you to WebScarab. WebScarab does EXACTLY what you are trying to do. Look in the code for ConnectionHandler.java. I'll even give you a link to it. http://cvs.sourceforge.net/viewcvs.py/owasp/webscarab/src/org/owasp/webscarab/plugin/proxy/ConnectionHandler.java?rev=1.27&view=markup Note that there is a big difference between doing the handshake, and getting the browser to trust your certificate. To get the browser to trust your certificate, it must be signed by a Certificate Authority that the browser recognises. WebScarab makes use of a self-signed certificate that causes a pop-up error message. To prevent this, you would need to import the certificate into your browser's certificate store. The process to do this will vary depending on the browser that you are using. Regards, Rogan -- Rogan Dawes *ALL* messages to [EMAIL PROTECTED] will be dropped, and added to my blacklist. Please respond to "nntp AT dawes DOT za DOT net" ========================================================================== TOPIC: JSP Struts <logic:equal> tag questions http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/135efce4ed8c9cd ========================================================================== == 1 of 1 == Date: Sun, Oct 31 2004 5:50 pm From: "Martin Froment" <[EMAIL PROTECTED]> <logic:notEqual name= "returnValue " value= "0 "> "Raymond Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I want to know if I use <logic:equal> tag, I need to take care all > different cases. Looks like there are no else tag in Struts. > > For example, in JSP scriplets without Struts, I may do this: > > <% > if (returnValue.equals("0") > { ... > } > else //means returnValue="1" > { ... > } > %> > > But in Struts, I need to do this: > <logic:equal name= "returnValue " value= "0 " > > ... > </logic:equal > > > <logic:equal name= "returnValue " value= "1 " > > ... > </logic:equal > > > //etc... > > In this case, that is fine. But if there are so many different cases, > it is tedious to specify all possiblitites in order to use > <logic:equal> tag. > > Please discuss and advise. Thanks!! ========================================================================== TOPIC: tomcat 4.1.30 and not recognizing new compiled code http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d037203a155ce61f ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 7:11 pm From: JScoobyCed <[EMAIL PROTECTED]> Ryan wrote: > Doesn't happen every time. I close my browser(using IE) and re-open. I > execute the same code. I am finding I have to frequently shut down and > restart the web server in order to get it to notice my new code? > > Maybe it is a IE caching issue (or even a browser caching issue). When I am in development phase of J2EE application, I always set up my browser to fetch the page at any request (under IE: Tools>Internet Options>General>Settings>"Check for newer version of stored pages">"Every visit to the page") -- JScoobyCed What about a JScooby snack Shaggy ? ... Shaggy ?! == 2 of 2 == Date: Sun, Oct 31 2004 8:09 pm From: "Madhur Ahuja" <[EMAIL PROTECTED]> Ryan <[EMAIL PROTECTED]> wrote: > Doesn't happen every time. I close my browser(using IE) and re-open. I > execute the same code. I am finding I have to frequently shut down and > restart the web server in order to get it to notice my new code? This is takem from a site: To turn on servlet reloading, edit install_dir/conf/server.xml and add a DefaultContext subelement to the main Host (Tomcat 5.0.20 and later) or Service (Tomcat 5.0.19 and earlier) element and supply true for the reloadable attribute. For example, in Tomcat 5.0.27, search for this entry: <Host name="localhost" debug="0" appBase="webapps" ...> and then insert the following immediately below it: <DefaultContext reloadable="true"/> -- Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com] Homepage http://madhur.netfirms.com ========================================================================== TOPIC: Turn off boundary checks? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fc5b4ab5a504cf9 ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 7:15 pm From: Markus Dehmann <[EMAIL PROTECTED]> I know that automatic boundary checks for array accesses is a good thing, prevents crashes at runtime and makes Java superior to, say, C. But what if I use arrays really heavily and I am sure that there are no undefined array elements queried -- shouldn't there be an option to turn the boundary checks off? It would probably improve the performance of my program a lot. The same for automatic initialization. I mean I know that Java is a safe language and rather checks everything twice to prevent undefined behavior or crashes. It's good to have this behavior as a default. But, after extensive testing, I can be sure that there are no invalid accesses, I would like to turn the automatic checks and initializations off! Just to see if it runs faster. Is there a JVM that supports that? Could I, in theory, hack an existing virtual machine to do that and re-distribute it? Thanks! Markus == 2 of 2 == Date: Sun, Oct 31 2004 8:11 pm From: Chris Smith <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > But what if I use arrays really heavily and I am sure that there are no > undefined array elements queried -- shouldn't there be an option to turn > the boundary checks off? It would probably improve the performance of my > program a lot. The same for automatic initialization. There is no option for either of these changes. Such options would mean behavior that's no longer compliant with the Java Language Specification. You'd probably also be surprised by how little difference they make in time efficiency of your code. If you're justifiably concerned by these sorts of differences, then you probably want to be hand-coding performance-critical code sections in assembly language anyway, and Java is not the right language to mix with assembly. The second request (turning off automatic initialization) is even worse; it would probably break most existing code, since almost any application of substantial size probably relies at least once on the default value of a variable, or uses some library (including the core API) that does. > Is there a JVM that supports that? Could I, in theory, hack an existing > virtual machine to do that and re-distribute it? Whether you could modify and redistribute a VM that does this depends on the license of the VM. You couldn't do it with Sun's VM code, since their license requires that your VM pass a compatibility test before it can be redistributed; and the compatibility test is almost certain to catch these deficiencies. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ========================================================================== TOPIC: Need help with VE of eclipse http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b9e183ba8f8af2a ========================================================================== == 1 of 1 == Date: Sun, Oct 31 2004 7:23 pm From: Markus Dehmann <[EMAIL PROTECTED]> sp wrote: > VE have the possibility of create user interface for swt WYSIWYG? Yes. > I find in palete only swing or awt component. No, the swt option should be there. > A stupid question: SWT use SWING or reimplement a own version of UI? SWT is totally different and has nothing to do with Swing. The two toolkits have opposite approaches: While Swing does pretty much all drawing by itself, SWT delegates as much as possible to the underlying platform. SWT calls the platform system calls to draw a window, a tree, etc. That's why it's much faster. Swing draws everything by itself, that's why a swing application always has its own Swing look, no matter if you run it on Windows, Linux or Mac. SWT applications are chameleons: On Windows they automatically look like Windows applications, on Mac like Mac applications etc. That's why SWT is so popular (with users, not with programmers! :-) Markus ========================================================================== TOPIC: Problem with Struts 1.1 and select box http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f2609668a5d78566 ========================================================================== == 1 of 1 == Date: Sun, Oct 31 2004 7:51 pm From: "Martin Froment" <[EMAIL PROTECTED]> You cannot use a simple array of String to populate your options list. You must use a Collection implementation to let "html:options" iterate through your options list. Struts 1.1 let you use the nested tag library, I suggest you to take a look at it, it's very interesting... <nested:select property="myProperty"> <nested:optionsCollection property="propertyOptions" label="optionLabel" value="optionValue" /> </nested:select> ...where propertyOptions is a Collection defined in your nested form ! a+ "cccc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I have a problem with this java code: > > I want populate a select box with Jakarta Struts 1.1 > > <% > String multipleValues[] = > { "Multiple 0", "Multiple 1", "Multiple 2", "Multiple 3", "Multiple 4", > "Multiple 5", "Multiple 6", "Multiple 7", "Multiple 8", "Multiple > 9" }; > pageContext.setAttribute("multipleValues", multipleValues); > %> > > <html:select property="multipleSelect" size="10" multiple="true"> > <html:options name="multipleValues" labelName="multipleValues"/> > </html:select> > > Can you help me? > > Ciao, > Carlo > > ========================================================================== TOPIC: why does ObjectInputStream constructor block reading a header http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7b8520ff9f293b96 ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 8:27 pm From: [EMAIL PROTECTED] (kartik) "Tony Morris" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > "kartik" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > The ObjectInputStream constructor blocks till it reads a header from > > the underlying input stream. This can cause deadlocks when you have a > > pair of object streams communicating over sockets (it has happened to > > me). Does anybody know why it may have been coded this way instead of > > reading the header on the first call to readObject()? > > > > -kartik > > Yes - they have been written in accordance with specification [...] Of course, but why is the spec that way? > [...] the specification is the correct way of solving the problem. What makes it so? > The problem you have is attempting asynchronous I/O in the same thread. I don't think so. All I'm trying to do is create an ObjectInputStream that reads from a socket, and I would not like to block while reading the header in the constructor, but only in the first call to readObject(). The rationale for this is that the stream header would not be written (on the sender) as yet, but it will be by the time I call readObject(). -kartik == 2 of 2 == Date: Sun, Oct 31 2004 8:40 pm From: [EMAIL PROTECTED] (kartik) Esmond Pitt <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > kartik wrote: > > The ObjectInputStream constructor blocks till it reads a header from > > the underlying input stream. This can cause deadlocks when you have a > > pair of object streams communicating over sockets (it has happened to > > me). Does anybody know why it may have been coded this way instead of > > reading the header on the first call to readObject()? > > No but you can avoid the deadlock by creating the ObjectOutputStream > first and flushing it, then creating the ObjectInputStream. That's what I did. Thanks, anyway. -kartik ========================================================================== TOPIC: What is Instance Initializer? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/15dac666512492d6 ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 11:10 pm From: [EMAIL PROTECTED] (hiwa) Will you give brief description and some examples for the Instance Initializers mentioned in JLS 8.6? For Static Initializers, I saw many of them in real codes. But, for Instance Initializers, never, I think... == 2 of 2 == Date: Mon, Nov 1 2004 12:34 am From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> [EMAIL PROTECTED] (hiwa) writes: > But, for Instance Initializers, never, I think... They're mostly used woth anonymous inner classes for code that would normally go in the constructor; the constructor for an anonymous inner class is synthesized by the compiler. ========================================================================== TOPIC: How to create a JAR file http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ea455ce0dfc0c521 ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 12:04 am From: [EMAIL PROTECTED] (Samar Hossam) Hi Andrew, > Which part did I swear at you, or yell at you? > Where did I tell you to do, or not do, anything? > > Which bit offended you, and how? First of all, I would like to stop this meaningless thread. Besides, maybe you are right. Anyway, I don't like to quarrel with anybody. If you see that I offended you, I am sorry. Regards. ========================================================================== TOPIC: Stupid null pointer exception http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aeeebd0bb6f11be3 ========================================================================== == 1 of 2 == Date: Sun, Oct 31 2004 11:48 pm From: "Peter Kirk" <peter> "Alex Hunsley" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > Stefan Schulz wrote: <cut> > > This is no problem. He defines a void instance method that by chance has > > the same name as the class. This is valid method, and the class has the > > implicit default constructor added by the compiler. > Thanks for putting me right there. I really though that the compiler > itself actually complained about that one - long long time since I've > tried such a thing! An IDE (for example Eclipse) can help here by high-lighting or otherwise indicating a method name which "clashes" with the class name. == 2 of 2 == Date: Mon, Nov 1 2004 1:02 am From: "Ann" <[EMAIL PROTECTED]> > use. All you did was add one line of snide comment. I know. ========================================================================== TOPIC: how do avoid passivate (about ejb)? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/796393a8f9a7e582 ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 1:02 am From: "Íõ" <[EMAIL PROTECTED]> how do avoid passivate (about ejb)? ========================================================================== TOPIC: Off Topic: Safari Bookshelf http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3d4c237d0e60a7ee ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 1:11 am From: [EMAIL PROTECTED] (Love Rhino) Hello. I'm wondering if anyone has a subscription of Safari Bookshelf? The website(s), give you access to all OReilly, Prenctice Hall, Sams, and Addison-Wesley computer books for about $15/month. I'm wondering if it's any good. I'd just like to know the feedback of those people who have used it. Also, the site says you can download 5 chapters at a time from a book, I'm wondering does that mean, I can only view chapters while I'm subscribed? Or can I view them at any time (e.g. offline, or after expired subscription), as if I 'owned' those files when I bought them. Plus, what is the format for the books? Are their several different formats? thanks for the feedback. ======================================================================= 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
