I am trying to query the google datastore for something like (with pm --> persistanceManager):
String filters = "( field == 'value' || field == 'anotherValue' )";
Query query = pm.newQuery(myType.class, filters);
When I execute - I am getting back: App Engine datastore does not support operator OR.
What's the best approach in peop...
I am writing a JSP application and am deploying it to JBoss 5.0. When I attempt to retrieve my CSS or Javascript files, JBoss returns the wrong Content-type for the file, so Firefox refuses to execute code supplied in them. Here is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLS...
Hello,
During the last 4 years, I was working on a project in my spare time having two goals : to improve myself as a software engineer and to build something which(I hoped) it will help me to build faster and better Java applications. I've always liked modular applications, so I though a plugginable framework wouldn't be bad to have.
...
I am working on a program written in Java which, for some actions, launches external programs using user-configured command lines. Currently it uses Runtime.exec() and does not retain the Process reference (the launched programs are either a text editor or archive utility, so no need for the system in/out/err streams).
There is a minor...
This one is for Java programmers on Mac.
How do I catalog Java API documents using Quicksilver? Wouldn't it be nice if you could lookup API documents with a few key strokes?
...
This post started out as "What are some common patterns in unit testing multi-threaded code ?", but I found some other discussions on SO that generally agreed that "It is Hard (TM)" and "It Depends (TM)". So I thought that reducing the scope of the question would be more useful.
Background : We are implementing a simple scheduler that g...
I plan to use the Quartz scheduler as I read many good opinions about it.
My problem is as follows: I will have thousands of triggers living in the system at any given time. Most of the triggers will fire just one event and die. In addition, it is very likely I will have to cancel many jobs after their allocation (based on new input).
...
In my facebook app, I figured out how to get a session_key by fetching the user's offline_access permission. (Using Facebook Java API)
However, what I could not find out:
How can I create an IFacebookRestClient using this key at a later point of time? Of course, as long as the session of my own app lasts, the client is stored within it -...
This applies to subclasses of Applet, Servlet, Midlet, etc.
Why do they not need a main()? If I wanted to create a Craplet class that starts at init() or something similar, is it bad design, or how would I go about doing it?
...
So I have a map:
Map<String, Class> format = new HashMap<String, Class>();
And I would add elements to it like this:
format.put("Vendor Number", Integer.class);
format.put("Vendor Dispatch", Date.class);
....
I have a generic method as follows:
public static <T> T verifyType(String name, Class<T> type) {
if (type == Integer.cla...
URL can have a label, separated with a "#" sign, coming after the URL parameters.
E.g. http://example.com/foo/bar.jsp?p1=v1#test_label
I would expect label to be part of request.getQueryString() and part of request.getRequestURL().toString().
But it doesn't seem to be there.
Is there a way to retrieve the label value from HttpServletRe...
class Test1<T> {
Test1(Class<T> type) {}
}
class Test2 extends Test1<Class> {
Test2() {
super(Class.class);
}
}
This works, but, I am warned about use of a raw generic type in "Test1<Class>". I understand that, but, changing it to "Class<?>" (which should be equivalent?) gives a compiler error in the call to super() -- Class...
Hello SO people,
when programming in Java I practically always, just out of habit, write something like this:
public List<String> foo() {
return new ArrayList<String>();
}
Most of the time without even thinking about it. Now, the question is: should I always specify the interface as the return type? Or is it advisable to use the ...
Hi all,
I'm a reasonably experienced Java programmer but relatively new to Java2D. I'm trying to scale an image but I'm getting poor quality results. The image is a preview of a panel so contains things like text and textfields. I'll always be scaling down, never up.
Currently I'm using the following code:-
g.drawImage(panelImage, 0, ...
I'm developing a java servlet web application that manages information from multiple databases (all structurally the same) each corresponding to a different "business". The user selects "the current business" which is stored in the session and the application can display or modify that "current business".
I would like to use tomcat ...
You can place a Quartz scheduler in stand-by mode. During this time all triggers will not fire neither jobs being executed. But what happend if the standby(); command comes up during a job that is in the middle of its execution, let's say it is in the middle of writing a file?
example:
*// start() was previously invoked on the schedul...
I want a nice way to get the current unix timestamp from a java Date object, this is my solution:
public class Date extends java.util.Date {
public int getUnixTimeStamp() {
int unixtimestamp = (int) (this.getTime() * .001);
return unixtimestamp;
}
}
That works fine, but the problem is when I try to cast a java...
I'm working on a simple Java application. Currently, I have two view, one for login in and another once you're logged in.
So my question is, once the user has logged in, should the controller of the login view creates the second view?
The problem is, the first controller needs to know every dependencies of the second view...
Edit : t...
Possible Duplicate:
Why do some claim that Java's implementation of generics is bad?
What's really so wrong with Java's generics? Or perhaps another way, what's so much better about other languages' implementations of similar concepts?
I don't mean to spark any wars, but I haven't programmed in Java since 1.4 (i.e. before gene...
Hello. I have two JSPs and a JavaBean that aren't working. This is a problem that's probably very common to newbies, so please forgive me if this has been answered in this forum. I've Googled all over the place for an answer to this, and although I'm not the only one who's ever had this problem, I can't seem to figure out what my prob...