I've been using spring for some time, but I always wondered how does it work, more specifically, how do they load and weave beans/classes marked only with an interface or @annotation.
For the xml declarations, it's easy to see how spring preprocesses my beans (they are declared in the xml context that spring reads), but for the classes...
Related to this question, how to save many different csv files into one excel workbook with one sheet per csv ? I would like to know how to do this programmatically in Java.
...
I have a Timestamp value that comes from my application. The user can be in any given local TimeZone.
Since this date is used for a WebService that assumes the time given is always in GMT, I have a need to convert the user's parameter from say (EST) to (GMT). Here's the kicker: The user is oblivious to his TZ. He enters the creation dat...
I know that you can run almost all Java in Dalvik's VM that you can in Java's VM but the limitations are not very clear. Has anyone run into any major stumbling blocks? Any major libraries having trouble? Any languages that compile to Java bytecode (Scala, Jython etc...) not work as expected?
...
We use Eclipse for our Java development, and we've got Maven compiling our JSPs into servlets to be used in our embedded Jetty instance. This means that to run the project from Eclipse, I have to include ./target/jsp-source as a source folder, which works great. The warnings that show up for that generated code are everywhere though, and...
Has Java 1.6 SDK been released for mac? I can't seem to find it...
...
I am new to jmock and trying to mock an HttpSession. I am getting:
java.lang.AssertionError: unexpected invocation: httpServletRequest.getSession()
no expectations specified: did you...
- forget to start an expectation with a cardinality clause?
- call a mocked method to specify the parameter of an expectation?
the test method:
@Tes...
Hi community,
Perhaps this question is not very clear but I didn't find better words for the heading, which describes the problem I like to deal with shortly.
I want to restrict access from a java desktop application to postgres.
The background:
Suppose you have 2 apps running and the first Application has to do some complex calcula...
I've been playing with DWR and converters for a while and I really wanted to map my Java classes to JavaScript classes. Using DWR converters, I have the option to point out what is the name of my JS constructor given a Java class. So far so good... The problem arises when my JS constructor is within a JS package-like name (just like YUI'...
I have the following code:
class IncidentTag:
def __init__(self,tag):
self.tag = tag
def equals(self,obj):
return self.tag.equals(obj.tag)
def hashCode(self):
return self.tag.hashCode()
from java.lang import String
from java.util import HashMap
from java.util import HashSet
tag1 = IncidentTag(Str...
Is there any elegant way in the Android API for detecting new media when it is written to the device? I’m mainly interested in photos taken by the camera, video taken by the camera and audio recorded from the mic.
My current thinking is to periodically scan each media content provider and filter based on last scan time.
I’m just wonder...
Question
I'm looking for a Java in-memory object caching API. Any recommendations? What solutions have you used in the past?
Current
Right now, I'm just using a Map:
Map cache = new HashMap<String, Object>();
cache.put("key", value);
Requirements
I need to extend the cache to include basic features like:
Max size
Time to live
...
I'd like a consistent and simple way to throw exceptions in JNI code; something that handles chained exceptions (implicitly from the env->ExceptionOccurred method, or explicitly by parameters, either way is good) and saves me looking up constructors every time I want to do this. All of the above is preferably in C, although I could tran...
Hi,
In my Spring app, I'd like to use FreeMarker to generate the text of emails that will be sent by my application. The generated text will never be returned to the view so I don't need to configure a FreeMarker view resolver. The documentation seems to indicate that I should configure a FreeMarkerConfigurationFactoryBean like this
<b...
After reading this old article measuring the memory consumption of several object types, I was amazed to see how much memory Strings use in Java:
length: 0, {class java.lang.String} size = 40 bytes
length: 7, {class java.lang.String} size = 56 bytes
While the article has some tips to minimize this, I did not find them entirely satisfy...
I'd like to use the Rhino JavaScript compiler to compile some JavaScript to .class bytecode files for use in a project. It seems like this should already exist, since there are groovyc, netrexxc, and jythonc tasks for Groovy, NetREXX(!) and Jython, respectively. Has anyone used or written such an Ant task, or can anyone provide some tips...
I am trying to implement an application by using MySQL/JAVA and I found this tool in netbeans to easily create a new form for an existing table. (edit, insert, delete etc.)
Is there an easy way to modify the code to join another table to display fields from that table.
Example:
I have an employee table that has a foreign key TitleID and...
How do you for a specific look and feel on NetBeans 6.5? I mean by passing flags to the netbeans script (on Ubuntu) or by modifying the netbeans script or by some setup.
...
I'm designing a multi-tiered database driven web application – SQL relational database, Java for the middle service tier, web for the UI. The language doesn't really matter.
The middle service tier performs the actual querying of the database. The UI simply asks for certain data and has no concept that it's backed by a database.
The qu...
This originally was a problem I ran into at work, but is now something I'm just trying to solve for my own curiosity.
I want to find out if int 'a' contains the int 'b' in the most efficient way possible. I wrote some code, but it seems no matter what I write, parsing it into a string and then using indexOf is twice as fast as doing it...