Scenario Imagine a REST service that returns a list of things (e.g. notifications)
Usage A client will continually poll the REST service. The REST service retrieves records from the database. If records are available, they are converted into JSON and returned to the client. And at the same time, the retrieved records are purged from the...
I am trying to validate a cell in the JTable as soon as the data is entered.
I want to make sure that say the correct code is entered in the code column.
Could anyone let me know how to do this please?
Thanks
...
Is there a tool that would allow me to check use of generic collections in code that must be compilable with Java 1.4? I would imagine example code as:
Map/*<String, Integer>*/ map = new HashMap();
map.put("abc", new Integer(3)); // ok
map.put("def", "ghi"); // warning
EDIT: Unfortunately the build process is "set in stone" to use J...
While developing an application it's quite useful to be able to quickly login as different users, with different roles, to see how the application presents itself.
Typing usernames and entering password is no fun, and a waste of time. What I'd like to do is:
add a page/panel with a list of available usernames;
clicking on a username w...
I am currently building a Java financial application that I need to add entitlements to, and was wondering what approaches people have taken to solve this problem, and whether there are any third party Java libraries that people would recommend.
Currently I have a number of users that can be broadly categorised into roles (e.g. "trader"...
I want to do something different with the last loop iteration when performing 'foreach' on an object. I'm using Ruby but the same goes for C#, Java etc.
list = ['A','B','C']
list.each{|i|
puts "Looping: "+i # if not last loop iteration
puts "Last one: "+i # if last loop iteration
}
The output desired is equivalent to:
...
When running the following class the ExecutionService will often deadlock.
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ExecutorTest {
p...
hi i am using weblogic 8.1 with myeclipse 6.0 when i am trying to run weblogic server it asking for config.xml in mydomain directory and i am trying to boot with default configuration than it throwing exception
"Exception raised: 'weblogic.management.configuration.ConfigurationException: Passwords do not match, unable to generate defau...
I have an easy self-signed an applet (done with keytool and the jarsigner):
public class NetAppletLauncher extends JApplet {
private static final long serialVersionUID = 1L;
public void init() {
exec("notepad c:/hello.txt");
}
public void exec(String command) {
try {
// launch EXE and grab stdin/stdout and stderr
Proc...
I am using DefaultTable Model for showing my records in Jtable.But there is a problem like in the picture.When i load jtable its showing like LJava.lang.Object type. NOT in string..How can i solve this.
Here is my codes ;
EntityManagerFactory emf = Persistence.createEntityManagerFactory("SwingDenemePU");
EntityManager em = emf.createEn...
I have created server program which will send an image file to the client.
My program works fine if the image is of 512 byte. But it does nit work fine for large file.
In this case i am not getting the exact image that i am supposed to get. means my recovered image is in some improper manner. So how to solve this problem
I am using jav...
I am using rmic in netbeans to generate stub and skeleton files.Herewith I have provided the tag, I'm using in "build.xml" in netbeans 6.5
<rmic base="${build.classes.dir}" classname="packageName.RmiServerClassName"/>
"RmiServerClassName" class is using some external jar files.I already have added the external jar files by using Proje...
any method available to place the JTextArea to the right of the JPanel??
...
Suppose I have the following types of data:
class Customer {
String id; // unique
OtherCustData someOtherData;
}
class Service {
String url; // unique
OtherServiceData someOtherData;
}
class LastConnection {
Date date;
OtherConnData someOtherData; // like request or response
}
Now I need to remember when each of the cust...
Is there any SOAP API that receives pre-made XMLS and wrap them with SOAP envelope (put the XML in the SOAP body/header as needed)?
I need the functionality of wrapping up XMLs with SOAP envelope directly without any object model manipulations (like SAAJ do).
10,
O'shea
...
Once I created a form builder where user could select any number of fields for a web form. The tool then produced a code snippet which user could copy in the JSP.
The submitted form data was stored as a key-value pairs in the DB, so basically just two columns were required for the form specific data. If I remember right, the processing ...
I'm searching a collection framework designed for huge datasets in Java that behaves transparently, like STXXL does for C++.
It should transparently swap to disk, but in a much more efficient manner than plain OS-based VM swapping. A StringBuffer/String drop-in replacement would be a big plus.
...
I'm unable to login to an HPUX host using telnet when the telnet process is created by a Java program.
When I telnet to the HPUX host from the command line (from bash), I am able to login and use the session.
When I spawn the telnet process from Java, something strange happens. I am prompted for the username and submit it. I also get t...
Hi,
I've developed a web application that worked fine in JBoss 4. Now, I need to make it work in Tomcat 6, but I'm having trouble to access some properties file. I use the following code to read read these files:
InputStream is = Thread.currentThread().getContextClassLoader()
.getResourceAsStream(fileName);
if (is == null) {
...
Hi,
I am little bit confuse about log4j in grails.
I need to log info into info.log, error into error.log and warning into warning.log
if possible, all the files (info,warning and error) should be placed into web-app/
so that i can do check via internet (vpn)
can someone help me to do that ?
...