comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * double '*' - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/737e08f82f0a0f79 * VM Error - heap memory problem - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/363218dc7986a594 * Question about: new URLDecoder().decode( Class.getResource().getFile() ) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e606e1f4dcfd19ab * Java was created in SODOM and GOMORRAH !!!! - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/241d795807847c94 * .class file includes debug info?? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/68f1bf9ec4850ab3 * New Site - jMinds - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/70af5677e5a2f13d * Encryption - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/73305142df80db72 * getLocalHost Question - 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4c429df340243d0 * Restricting directory access of a Process created using System.exec(..) - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f8db9fd7afc2650 * JSP, session, 'caching' - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9b4a7e1061e7b01c * Using JAXP 1.3 with J2EE 1.3.1 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f51b7d48305fbc7 * Console from GUI? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/916a2f91d4c72ba3 * Help with regular expression? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6df7001ce71f68e7 * Please helpppppp me on base64 Codec - jakarta - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5a122782d774c0a * JSTL tags in output - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5784c409befba099 ============================================================================== TOPIC: double '*' http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/737e08f82f0a0f79 ============================================================================== == 1 of 3 == Date: Tues, Dec 21 2004 4:17 pm From: Alain Laroche Hi, in ant files I often see a double star "**" instead of a single star in patterns given as arguments to some attributes. Example: <patternset id="non.test.sources"> <include name="**/*.java"/> </patternset> Why are two '*' needed,as a single star already matches any number of characters? Is there a difference with <include name="*/*.java"/>? Thank you. == 2 of 3 == Date: Tues, Dec 21 2004 3:26 pm From: Joona I Palaste Alain Laroche <[EMAIL PROTECTED]> scribbled the following: > Hi, > in ant files I often see a double star "**" instead of a single star in > patterns given as arguments to some attributes. > Example: > <patternset id="non.test.sources"> > <include name="**/*.java"/> > </patternset> > Why are two '*' needed,as a single star already matches any number of > characters? Is there a difference with <include name="*/*.java"/>? > Thank you. It's a special trick. "**" isn't parsed as two '*', it's a special token on its own right, meaning "every subdirectory inside this directory, no matter how deep in the directory tree". -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-------------------------------------------------------- rules! --------/ "C++ looks like line noise." - Fred L. Baube III == 3 of 3 == Date: Tues, Dec 21 2004 2:00 pm From: "John C. Bollinger" Joona I Palaste wrote: > Alain Laroche <[EMAIL PROTECTED]> scribbled the following: >>Why are two '*' needed,as a single star already matches any number of >>characters? Is there a difference with <include name="*/*.java"/>? > > It's a special trick. "**" isn't parsed as two '*', it's a special token > on its own right, meaning "every subdirectory inside this directory, no > matter how deep in the directory tree". And a single * _doesn't_ match just any arbitrary sequence of characters. In particular, it doesn't match anything that involves traversing a subdirectory as part of the match. John Bollinger [EMAIL PROTECTED] ============================================================================== TOPIC: VM Error - heap memory problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/363218dc7986a594 ============================================================================== == 1 of 2 == Date: Tues, Dec 21 2004 10:18 am From: "John C. Bollinger" Surendra Singhi wrote: > Hi, > I am using Java on a windows xp machine. Recently while writing a > program which takes large amount of memory I ran into this runtime > error. And it is giving me nightmares, as I have a very important > deadline to meet. > The program takes large amount of memory so I tried increasing the heap > size and set the following options for the vm > -verbosegc -ms128m -mx128m Your limits there aren't really that big. On the other hand, the GC output you posted doesn't show your program coming anywhere near using it all. > Also, at one or two places I am explicitly calling gc, to help free up > some memory. That should never be necessary. It is also unlikely to be related to your problem. > The time the program will take to execute is not a concern > as long as it runs smoothly. > > Attached is a part of the trace of the gc run and the run time error. Snipped automatically by my newsreader because you put it in your signature. In any case, the VM is reporting an internal error. This most likely indicates one of: a bug in the VM, corrupted VM or class files (system or user), or some kind of unrecoverable error in native code. I would try the application on a different system first, preferably the cleanest one you can find. > How to fix this bug? And is it memory allocation which is causing it? The bug is unlikely to be caused by Java memory allocation -- if Java cannot allocate enough memory then it throws an OutOfMemoryError. If you're doing any JNI then I would look there first for a bug. It is possible that there is no bug in your code. Do note that the error message asks you to report the incident as a VM bug, although it might be a bit hasty to do that without verifying that you can duplicate it in a clean environment. John Bollinger [EMAIL PROTECTED] == 2 of 2 == Date: Tues, Dec 21 2004 7:27 pm From: "JML" Hi, besides increasing the heap memory (this is a temporal solution), you should use profiler software to search the memory leaks in your app. Maybe you allocate many needless objects in the heap memory, with a profiler you can see the live instances of each created object in a determinated moment. "Surendra Singhi" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Hi, > I am using Java on a windows xp machine. Recently while writing a > program which takes large amount of memory I ran into this runtime > error. And it is giving me nightmares, as I have a very important > deadline to meet. > The program takes large amount of memory so I tried increasing the heap > size and set the following options for the vm > -verbosegc -ms128m -mx128m > Also, at one or two places I am explicitly calling gc, to help free up > some memory. The time the program will take to execute is not a concern > as long as it runs smoothly. > > Attached is a part of the trace of the gc run and the run time error. > > How to fix this bug? And is it memory allocation which is causing it? > > Any help on this will be heartily appreciated. > Thanks in advance. > > -- > Surendra Singhi > > www.public.asu.edu/~sksinghi/ > > > [GC 14246K->6146K(130112K), 0.0047735 secs] > [GC 14273K->6473K(130112K), 0.0017715 secs] > [Full GC 9045K->6183K(130112K), 0.0460307 secs] > [GC 14310K->6221K(130112K), 0.0022045 secs] > [GC 14349K->6206K(130112K), 0.0014379 secs] > [GC 14333K->6222K(130112K), 0.0006643 secs] > [GC 14350K->6206K(130112K), 0.0005355 secs] > [GC 14334K->6209K(130112K), 0.0005559 secs] > [GC 14337K->6212K(130112K), 0.0006160 secs] > [GC 14339K->6215K(130112K), 0.0019924 secs] > [GC 14343K->6218K(130112K), 0.0006233 secs] > [GC 14346K->6232K(130112K), 0.0021648 secs] > [GC 14360K->6229K(130112K), 0.0007012 secs] > [Full GC 6988K->6229K(130112K), 0.0446780 secs] > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) > # > # Error ID: 43113F2652414D452D41503F491418160E435050005C > # > # Problematic Thread: prio=5 tid=0x0035f020 nid=0x358 runnable > # > > Heap at VM Abort: > Heap > def new generation total 9088K, used 2794K [0x10010000, 0x109e0000, > 0x109e0000) > eden space 8128K, 34% used [0x10010000, 0x102cab28, 0x10800000) > from space 960K, 0% used [0x10800000, 0x10800000, 0x108f0000) > to space 960K, 0% used [0x108f0000, 0x108f0000, 0x109e0000) > tenured generation total 121024K, used 6229K [0x109e0000, > 0x18010000, 0x18010000) > the space 121024K, 5% used [0x109e0000, 0x10ff5628, 0x10ff5800, > 0x18010000) > compacting perm gen total 4096K, used 2159K [0x18010000, 0x18410000, > 0x1c010000) > the space 4096K, 52% used [0x18010000, 0x1822bcc8, 0x1822be00, > 0x18410000) > > ============================================================================== TOPIC: Question about: new URLDecoder().decode( Class.getResource().getFile() ) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e606e1f4dcfd19ab ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 7:27 am From: [EMAIL PROTECTED] I got an executable file that is a resource of a java class. This executable gets run using Runtime.getRuntime().exec which needs a String path To get my String path for exec I first get the URL of the executable using getResource() . URL has a getFile method which returns a String. This String is not the right one for exec because it is URL encoded with sequences like %20 and %25. Not much trouble, just use URLDecoder to get at the String. Here is the question: Does getResource() return a URL in a particular encoding? Alternatively I can see getResource() return a platform specific encoding in which case I want URLDecoder.decode(String) which is deprecated because it uses platform specifc encodings. Cheers ============================================================================== TOPIC: Java was created in SODOM and GOMORRAH !!!! http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/241d795807847c94 ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 7:52 am From: "[EMAIL PROTECTED]" Java is architected based on experience with other languages and it's about the best technology there is for a programmer. It may take time for the rationals to take or, better jive, with your motives mon. Take it easy... ============================================================================== TOPIC: .class file includes debug info?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/68f1bf9ec4850ab3 ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 1:08 pm From: "Chris Uppal" [newgoups trimmed a little] [EMAIL PROTECTED] wrote: > I'm looking for a command-like utility which can read a .class file and > tell you whether it includes debug information, i.e. whether it was > built with the -g option of javac. You could find out by parsing the classfile (use whatever bytecode library comes to hand). But that might be overkill for your application. If so, then an approximate approach like checking whether the .class file contains the strings "LocalVariableTable" and "LineNumberTable" (with that exact case) should be a good approximation, provided that you you don't mind a small risk of false positives. That last test "works" -- if it does -- because the debugging info is stored as so-called "attributes" with those names; attributes are named sub-sections of the classfile. -- chris ============================================================================== TOPIC: New Site - jMinds http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/70af5677e5a2f13d ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 4:22 pm From: Collin VanDyck Lewis Sellers wrote: > Maheshwaran S wrote: > > Hi Java geeks, > > > > We are maintaining site called jMinds( > > http://jminds.hollosite.com) features with lot of articles, programs, > > FAQ's and with other stuff too. Resources for the technologies in java, > > jdbc , j2ee such as JSP, Servlets, EJB ( Enterprise Java Beans ) etc > > from the writers of DeveloperIQ magazine and others. Contains, > > articles, source code for programming, tutorials and FAQ's. > > jMinds Team. > > (http://jminds.hollosite.com) > > > > " > How can I implement a thread-safe JSP page? > > You can make your JSPs thread-safe by having them implement the > SingleThreadModel interface. This is done by adding the directive <%@ > page isThreadSafe="false" % > within your JSP page. > " > > I've yet to write a jsp myself, and know almost nothing about it but.... > is that true? :) isThreadSafe="false" makes the page thread safe? Seems > a little counterintunitive to say the least. /-) I'm also not very knowledgeable on JSP, but I can see where this would make sense if the servlet container created a new servlet instance for each request if isThreadSafe='false'. The logic being, of course, that if the container prevents a JSP/Servlet instance from being accessed from multiple threads/requests then the appearance of the JSP/Servlet to the end user is as if it were threadsafe. I'd imagine that isThreadSafe='true' would then instruct the container to compile, generate, and instantiate one instance of the JSP to serve content across all requests. ============================================================================== TOPIC: Encryption http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/73305142df80db72 ============================================================================== == 1 of 3 == Date: Tues, Dec 21 2004 5:46 pm From: "Kevin" I am trying to re-write a Perl program in Java (don't ask why ;-) I am having problems finding Java equivalents for the Perl encode_base64, used for encoding files for transmission, and crypt, used for encrypting passwords, functions. Can anyone help me? There does seem to be some encryption support in Java but it isn't clear how to use it in place of the Perl functions mentioned. Cheers, K == 2 of 3 == Date: Tues, Dec 21 2004 6:47 pm From: Juha Laiho "Kevin" <[EMAIL PROTECTED]> said: >I am having problems finding Java equivalents for the Perl encode_base64, >used for encoding files for transmission, and crypt, used for encrypting >passwords, functions. For base64-encoding, it looks like Jakarta Commons Codec is the library you're looking for. See http://jakarta.apache.org/commons/codec/ . Other implementations also exist. For the other; see what you get with http://www.google.com/search?q=java+%22unix+crypt%22 For the "unix crypt" support, if you're after something that fills the same functionality (one-way password hashing), but do not require compatibility with the Unix crypt() -hashes, I'd recommend hashing the passwords with either MD5 os SHA1 instead of the old DES-based crypt(). -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) == 3 of 3 == Date: Tues, Dec 21 2004 2:46 pm From: Sudsy Kevin wrote: > I am trying to re-write a Perl program in Java (don't ask why ;-) > > I am having problems finding Java equivalents for the Perl encode_base64, > used for encoding files for transmission, and crypt, used for encrypting > passwords, functions. > > Can anyone help me? > > There does seem to be some encryption support in Java but it isn't clear how > to use it in place of the Perl functions mentioned. Been there, done that, wrote an article which you can find here: <http://www.sudsy.net/technology/pcrypto.html> ============================================================================== TOPIC: getLocalHost Question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4c429df340243d0 ============================================================================== == 1 of 4 == Date: Tues, Dec 21 2004 10:18 am From: [EMAIL PROTECTED] Hey everybody, I'm trying to write a java program that includes the capability to look up the local host's IP address. The problem that I'm having is when the user is behind a router. Then, rather than returning the IP address of the router itself, it returns the address assigned to that user by the router (which does no good to anybody who is not on the router). So far, I have used: InetAddress iAddr = InetAddress.getLocalHost(); Which works if the person is not behind a router, but not if they are. Does anybody know how I could solve this? Thanks, Ben == 2 of 4 == Date: Tues, Dec 21 2004 10:37 am From: "Yamin" What would you expect getLocalHost() to return? It returns the ip address assigned to the computer. On a home router, that's probably 192.168.1.X or whatever. Believe it or not, that's all your local PC knows about. Any packets not destined on the same network (192.168.1.something), are sent to the router (192.168.1.1). The router then does some translation replacing your computers source ip address (192.168.1.X) with the router's IP address and keeps track of everything. This is all done transparently without your local PC knowing what's going on. Its both a beauty and a curse. This is the reason two people, both behind a router, find it hard to communicate directly with each other (direct file transfers...) If what you want is the 'external' ip address (the one assigned by your ISP for example to your router), you'll have to find other ways around it. How do you plan on using this ip address BTW? == 3 of 4 == Date: Tues, Dec 21 2004 10:52 am From: [EMAIL PROTECTED] Yamin, Thanks for the info. Unfortunatly, the "other ways around it" is exactly what I'm looking for. I'm writing a distributed poker program. Ideally, I want the user to be able to run the 'server', and have it spit out an IP address that all of his friends could use to connect to his computer. I realize that this IP address can be found by looking at the router's information, but I'd like to set things up so even an idiot could get it to work. -Ben == 4 of 4 == Date: Tues, Dec 21 2004 12:05 pm From: "Yamin" :) You're just run into the common problem I mentioned with direct file transfers. Take any multiplayer game, IM client...they all have the same problem you've just talked about. A lot of the time, their solution is simply...you can't do it. The other alternative is to use upnp. I think most modern routers/OS support it. I don't know too much about it. You might want to look around for java libraries for it... In general though, on the 'server' computer they would have to configure the router to forward the port to their local PC. They'd create an entry something like this: Send all packets coming in to the router on port Y to 192.168.1.1 port Z. You would have to publish port Y somewhere (probably make it user configurable). The thing here is that if they can setup port forwarding...chances are they can get their ip address. However, it might be nice even for the 'expert' to automically have his external ip address show up, so he can easily tell his friends about it. One way to do this off the top of my head is to visit a website that will show it. Check out http://www.whatismyip.com. You could perhaps just link that html page in your application, or if you're really really really cool, get that webpage, parse it, and extract the ip address. At the end, this expert would still need to publish his ip/port to his friends by phone, msn, e-mail, webpage... Yamin ============================================================================== TOPIC: Restricting directory access of a Process created using System.exec(..) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f8db9fd7afc2650 ============================================================================== == 1 of 2 == Date: Tues, Dec 21 2004 10:21 am From: [EMAIL PROTECTED] Folks, I am writing a Java application to execute a program (C++/Java) by using System.exec method. Is it possible to restrict the process (that is created using System.exec(...) method) that is executing the program to grant access permissions (like read, write, execute, ) to only a particular directory and revoke all access permissions to all other directories and files. Please let me know if it is possible. If so how? Thanks in advance, Ajay. == 2 of 2 == Date: Tues, Dec 21 2004 8:19 pm From: Gordon Beaton On 21 Dec 2004 10:21:44 -0800, [EMAIL PROTECTED] wrote: > I am writing a Java application to execute a program (C++/Java) by > using System.exec method. > > Is it possible to restrict the process (that is created using > System.exec(...) method) that is executing the program to grant > access permissions (like read, write, execute, ) to only a > particular directory and revoke all access permissions to all other > directories and files. > > Please let me know if it is possible. If so how? Your question really has nothing to do with Java, and everything to do with the operating system you use (which you neglected to specify). Assuming a Unix-like system, you can do it with chroot, although you might need to be root. /gordon -- [ do not email me copies of your followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e ============================================================================== TOPIC: JSP, session, 'caching' http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9b4a7e1061e7b01c ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 1:55 pm From: "John C. Bollinger" Rico wrote: > On Fri, 17 Dec 2004 15:31:39 -0500, John C. Bollinger wrote: > >>Rico wrote: >> >>>I'll be looking up some example of how to use what I think should be >>>'session' scope to achieve what I described. Suggestions welcome though. >>> >>>I'm mainly wondering if there could be any tools or libraries that would >>>ease the implementation of this kind of, how to call it... caching? that >>>I am considering? >> >>You could select all the rows into a scrollable, updatable ResultSet, >>then hold the ResultSet in the session across requests. There are all >>sorts of gotchas and caveats there, especially in the area of >>scalability, but if you only need to support a handful of concurrent >>users then it could be made to work without too much hassle. It has the >>advantage of being able to cache unread results _in the DB_ rather than >>in memory, supports user modifications in a straightforward way, and >>only requires one query. > > > Amongst those gotchas and caveats, would there be a requirement to provide > the client with a close() method that they have to call for the bean to > know to release the connection? That's not required, and since you can't safely assume that the client will _use_ such a feature, it may not be worth your effort to code it. > Or is there a mechanism for when the session expires? Yes, there is. The Servlet API contains interfaces HttpSessionListener and HttpSessionBindingListener. The former is for receiving notification when sessions are created and destroyed, and the latter is for receiving notice when objects (attributes) are bound to or unbound from a session. You can create an implementation of one of these and configure your webapp's deployment descriptor to declare it as a listener for the webapp. The container will automatically instantiate the class for you and register the instance to receive the appropriate events. Of the two relevant listeners, you will probably find the latter easier to use. You may also want to note several things: () a Statement may only have one open ResultSet at a time. If you use a Statement to execute a new query (or an update, I believe) then any existing ResultSet associated with that Statement is closed. () Closing a Statement automatically closes any ResultSet associated with it, but the reverse is not true. () A Connection may have multiple open Statements associated with it. Closing a Connection probably causes all of them to close, but the API docs (v. 1.4) do not guarantee that. > E.g, I am using a ConnectionPool and performing JNDI lookups by making use > of Tomcat's "context". So, upon the session expiring would the context > implementation be able to free the resources for reuse? The context no responsibility anything like that. It is simply a naming and directory provider. The ConnectionPool is the object that you might imagine would have that responsibility, but it doesn't have enough information to know when you are done with a particular Connection. It is your responsibility to inform it by releasing the Connection back to the pool when you're done with it. You can approach that problem by use of one of the listeners described above. John Bollinger [EMAIL PROTECTED] ============================================================================== TOPIC: Using JAXP 1.3 with J2EE 1.3.1 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f51b7d48305fbc7 ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 10:57 am From: [EMAIL PROTECTED] (Hugh McBride) I am trying to use the new XInclude feature of JAXP 1.3 (unbundled) but I am restricted to J2EE 1.3.1 . I have already placed the dom.jar, sax.jar xalan.jar and xercesImple.jar in the <java_home>jre/lib/ext/ directory (using the endorsed directory is for JDK 1.4 . But the sample XInlcude demo included will not compile. What info I could find said not to add the jaxp-api.jar (Have tried it with and with out still doesnt work The main method of the of the class is below with the line causing the problem marked Any help/pointer would be greatly appreciated . Am using eclipse 3.0 as an editor and am sure there is no problem there public static void main(String argv[]) { if (argv.length < 2) { printUsage(); System.exit(1); } try { --> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); // make parser xinclude aware by setting the XIncludeAware to true. dbf.setXIncludeAware(true); dbf.setNamespaceAware(true); // parse the xml file. DocumentBuilder parser = dbf.newDocumentBuilder(); parser.setErrorHandler(new ErrorHandlerImpl()); Document doc = parser.parse(argv[0]); // write the output to specified file. DOMImplementation impl = doc.getImplementation(); DOMImplementationLS implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0"); DOMErrorHandlerImpl eh = new DOMErrorHandlerImpl(); Output out = new Output(); LSSerializer writer = implLS.createLSSerializer(); writer.getDomConfig().setParameter("error-handler", new DOMErrorHandlerImpl()); out.setSystemId(argv[1]); writer.write(doc, out); System.out.println("//////// finished /////////"); } catch (Exception ex) { System.out.println("Error occurred" + ex); } ============================================================================== TOPIC: Console from GUI? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/916a2f91d4c72ba3 ============================================================================== == 1 of 2 == Date: Tues, Dec 21 2004 11:06 am From: "Bilal" Ja, Vielen Dank. == 2 of 2 == Date: Tues, Dec 21 2004 7:28 pm From: "Ann" "Bilal" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I've built a tiny interpreter for a tiny programming language. > The program has a GUI that enables the user to write his code in a HER code :-) or in Japan (-_-) > text-box and then run the program. > The language contains two instructions: > > read <variable> > write <expression> > > To achive these two instructions I'm thinking of a text-based console. > > How can I create a console from within a frame-based GUI porgram? > How can I then deal with the in and the out? > > I'm using Borland's JBuilder so for now, I can use the "Messages" Panel > to cope with writing... > > I'm running both Windows and Linux. > > Is there a swing bean that emulate exactly the console (DOS for > example)? > > Thanks in Advance. > ============================================================================== TOPIC: Help with regular expression? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6df7001ce71f68e7 ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 7:34 pm From: Linda Thanks for the info, Tilman. I'll watch the Regexp thread for more. -L ============================================================================== TOPIC: Please helpppppp me on base64 Codec - jakarta http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5a122782d774c0a ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 11:43 am From: [EMAIL PROTECTED] (jsp beginner) Hi guys I am a beginner on JSP. I have a script to decode a string but it generates an error. This is what I did. 1. Download "commons-codec-1.3" from the Jakara web site. - http://jakarta.apache.org/commons/codec/ 2. And put it onto this directory - C:\Tomcat4\commons-codec-1.3 3. Set up the jar file in classpath like - C:\Tomcat4\commons-codec-1.3\commons-codec-1.3.jar; 4. Rebooth my machine. 5. Run my jsp script below. 6. Apache error. * My tomcat set up is working fine. All my jsp files work fine but I guess I am doing wrong with this following script and the set-up with the CODEC. Please help me what I am doing wrong. Do I add "import" in the first tag next contentType property? If so, what should it be? <%@ page contentType="text/html;" import="what?" %> This is the jsp file. <base64.jsp> <%@ page contentType="text/html;" %> <% String hi = "hello"; byte[] encodedBytes = Base64.encodeBase64(hi.getBytes()); String decodedString = new String(Base64.decodeBase64(encodedBytes)); %> show me <%=decodeString%> ============================================================================== TOPIC: JSTL tags in output http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5784c409befba099 ============================================================================== == 1 of 1 == Date: Tues, Dec 21 2004 2:54 pm From: Sudsy [EMAIL PROTECTED] wrote: > Hi, > > What are some of the more common reasons for JSTL tags appearing in the > final generated HTML? Where should I start to look? Most common cause is that the taglib couldn't be located. You need something like this in your JSP: <%@ taglib uri="c" prefix="c" %> You also need something like this in your WEB-INF/web.xml file: <taglib> <taglib-uri>c</taglib-uri> <taglib-location>/WEB-INF/tld/c.tld</taglib-location> </taglib> And of course you need the actual tld file in the named location. Finally, you need the jar containing the taglib classes in your WEB-INF/lib directory. ============================================================================== 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
