why boolean in java takes only true or false? why not 1 or 0 also.
is there any reason why java booleans take only true or false why not 1 or 0 also? ...
is there any reason why java booleans take only true or false why not 1 or 0 also? ...
I read everytime Filters are like servlets. Resin is a servlet container. Is there exist any filter container to initialize filters or does it take the role in servlet container only. Can anybody elaborate how it works? ...
According to many examples it is possible to inject an EntityManager into @Stateless or @Singleton EJBs like this: @Stateless // or @Singleton public class MyRepository { @PersistenceContext private EntityManager em; ... } The EJB 3.1 Spec says that dependency injection is only performed at construction time, so that all call...
How can I detect if my Swing App is being run from a windows RDP session? Java only solution preferred, but the app is guaranteed to be running on windows so I'm ok with shelling out. ...
My code is doing things like this: for(SomeObject so : someObjects) { Blah b = so; NewObject n = dao.GetNO(b.23); } i.e. it is creating a new variable inside the for loop on each iteration. Could this be the cause of the out of memory issue? The error reported by Netbeans: Caused by: java.lang.OutOfMemoryError: Java heap space ...
I'm working on a Java Annotation Processor and have problems to understand how to use the API in practice. I have many different annotations and like to emit errors (and create code) depending on the parameters of the annotations. What open source projects are out there that use "javax.lang.model.element" and can serve as an example of ...
We are using the Windows installation of Tomcat 6. By default, the log4j output for our app goes to the ${catalina.base}/logs/stdout_.log file. This log file only rolls over when we restart Tomcat, and the file name always includes the date. I would prefer it to behave like a DailyRollingFileAppender, where it renames the file when it...
In our system we have multi-threaded processing engine. During processing each thread calls methods to retrieve data from the database. We determined that performance is greatly improved if methods called from the same thread use the same DB session (sessions are coming from the pool of course). Is there any standard way in Spring to e...
Hello StackOverflow... Could anybody tell me how I can override HashSet's contains() method to use a regex match instead of just equals()? Or if not overriding, how I can add a method to use a regex pattern? Basically, I want to be able to run regex on a HashSet containing strings, and I need to match substrings using regex. If my met...
I have a servlet deployed as a war in JBoss 4.0.2. I have a properties file for the deployed application. Where should I put this file? Under the conf directory in the jboss server\default\conf folder? How do I load that properties file in a portable manner? ...
Have an envelope that I'm passing through a socket. Like <task> <doc> This is the contents of a file </doc> </task> Works great with text docs using a pattern like "<doc>(.*?)</doc>", Pattern.DOTALL but put the contents of a word doc in there and can't get it out. Any Ideas? Jim ...
Without having the source code for a Java API, is there anyway to know if the API methods create multiple threads ? Are there any conventions to follow if you are writing Java APIs and they create multiple threads. This may be very fundamental question but it happened to spawn out of a discussion in which the crux question was - " How do...
so I think I increase my heap size to 1 GB in netbeans, I changed the config to look like: netbeans_default_options="-J-Xmx1g ...... I closed and started up netbeans again, can I be sure that my app is given 1GB now? or is there a way to verify this? ...
I am trying to write an application for google app engine that would be available only for myself. (I know it sounds strange..just for the time being) I am trying to write a Login servlet that would authenticate user using google's UserService and let the user into the app only if I login and would show a brief message prompting for logo...
For example I've 3 books: Booknumber (int), Booktitle (string), Booklanguage (string), Bookprice (int). now I want to have an array called books[3][4]. I'm gettin the data I set via setBooknumber like this: Book1.getBooknumber(), Book1.getBooktitle(),...,Book3.getBookprice(). Now how do I realize this books[3][4] array. I can't call ...
Hey, I'm doing a project which is going to run on Websphere. I'm using JSF/Facelets/Richfaces for this project. I want to use the JBoss EL implementation as it allows calling methods with parameters from EL etc. ... usually this is accomplished by getting the JBoss EL jar and then putting this in the web.xml: <context-param> <par...
Hi all, Can any one explain with simple example of Command Pattern. I refer in internet but i got confused. Thanks, Ravi ...
I'm drawing a design for a system to do daily business functions for my company. It will consist of a Oracle 10g database with Pl/SQL packages and a Java-based web application. All of this is running on a Solaris 10 server. Aside from handling transactions from the web interface, scheduled tasks need to run on the database to run calc...
Hi there, I'm writing a simple Game of Life program in Java and am having a bit of trouble getting it to animate. I've got a JComponent class LifeDraw, which displays a grid of pixels, with the following paint method: protected void paintComponent(Graphics g) { super.paintComponent(g); for (int y = 0; y < lGrid.getHeight(); y+...
I am working on an embedded Linux device that has only qt. For some reason, Java decides to use gnu.java.awt.peer.gtk.GtkToolkit. How can I force it to use gnu.java.awt.peer.qt.QtToolkit instead (or change the default behavior)? ...