What's the best practice to render JSON data in JSPs?
I need to render JSON data in my JSPs for some AJAX requests. I'd like to know what's the best way to do it in terms of easy to use and stability. ...
I need to render JSON data in my JSPs for some AJAX requests. I'd like to know what's the best way to do it in terms of easy to use and stability. ...
I'm looking for a reliable, implementation-independent way to clone an entire Document. The Javadocs specifically say that calling cloneNode on a Document is implementation-specific. I've tried passing the Document through a no-op Transformer, but the resulting Node has no owner Document. I could create a new Document and import the n...
Hi, I've been using the Java Pet Store and .Net Pet Store examples for years when comparing JEE and .Net performance in an eBusiness type setting. Is there a better way to compare the performance of JEE and .Net for this type of application? Update: As some have pointed out below, the implementation, framework versions, architecture...
Let's say I do something in Java like: RemoteResponse response = null; try { FutureTask task new FutureTask(....); executor.execute(task); response = task.get(1000, TimeUnits.MILLISECONDS); } catch( TimeoutException te ) { .. should I do something special here? ... .. what happens to the return value of the task if ...
currently I have the following code: String select = qry.substring("select ".length(),qry2.indexOf(" from ")); String[] attrs = select.split(","); which works for the most parts but fails if given the following: qry = "select a,b,c,DATETOSTRING(date_attr_name,'mm/dd/yyyy') from tbl_a"; what I'm looking for is the regex to feed to S...
This could be the dumbest question ever asked but I think it is a total confusion for a newbie. Can somebody clarify what is meant by immutable? Why is a String immutable? What are the advantages/disadvantages of immutable objects? Why should a mutable object such as StringBuilder be preferred over String and vice-versa? A nice example (...
I have a factory that returns an interface FormatService: public class FormatServiceFactory { public FormatService getService() { ... } } Is it possible to mock out this factory so that it will always return a stub implementation of FormatService - FormatServiceStub in our unit tests? ...
Does anybody have experience using the open source offering from Terracotta as opposed to their enterprise offering? Specifically, I'm interested if it is worth the effort to use terracotta without the enterprise tools to manage your cluster? Over-simplified usage summary: we're a small startup with limited budget that needs to process ...
Hey everyone, I am trying to run the following program, but am getting a NullPointerException. I am new to the Java swing library so I could be doing something very dumb. Either way here are my two classes I am just playing around for now and all i want to do is draw a damn circle (ill want to draw a gallow, with a hangman on it in the e...
I have never actually held a job as a professional programmer, yet I have done a lot of training, and have contributed to production projects. I am about to do my Enterprise Architect Certification in Java, and would like to know what level jobs each certification would open the doors to. What certifications in Java would correlate t...
Where can I find good tutorials for OpenGL programming using Java? ...
Where can I find sample code on mouse movements and polygon spins in OpenGL? I am using Java, so sample code in Java is preferred. ...
These days, many projects have started their life written in Java. Some of them are eventually converted to C# for incorporation in .NET. Examples that come to mind are log4net, nhibernate and db4o. Including sharpen (which is db4o's tool) have you seen and/or used any tools that make continual conversion manageable. I'd go so far as...
Hai, I am implementing a Comment box facility in my application which user can resize using mouse. This comment box contains a scrollpane which instead contains a JEditorPane in which user can insert comment. I have added the editor pane inside a scroll pane for the following reason: auto scolling of jeditorpane When the user resizes ...
I have often heard this term being used, but I have never really understood it. What does it mean, and can anyone give some examples/point me to some links? EDIT: Thanks to everyone for the replies. Can you also tell me how the canonical representation is useful in equals() performance, as stated in Effective Java? ...
Spring IoC container gives you an option of replacing a method of a bean. Can someone provide a real life example of using this feature to solve real life problem? I can see this used for adapting an old legacy code (w/o sources) to work with your app. But I think I would consider writing an adapter class using the legacy code directly ...
I have some code that effectively does this : File file = new File("C:\\Program Files (x86)\\Something\\fred.txt"); System.out.println("file.canWrite() = " + file.canWrite()); It prints true. Now the odd thing is, I can create the file without any exceptions. Furthermore, another program can read the file I've created. The thing is, i...
I have let's say two pc's.PC-a and PC-b which both have the same application installed with java db support.I want from time to time to copy the data from the database on PC-a to database to PC-b and vice-versa so the two PC's to have the same data all the time. Is there an already implemented API in the database layer for this(i.e 1.exp...
I've been thinking of ways of providing syntactic sugar for a framework I have been working on. I want to deal with Immitable objects exclusively. Say I have an immutable object and wish to create a modified version of it. Would, in your view, a non-instantiable class with a single static factory method break OO principles ? As an...
I'm developing an application using Java, Tomcat, Spring Framework and Spring LDAP 1.2.1 for LDAP access. According to our LDAP administrator, it is not possible to find out programmatically, if a specific user is locked out in the directory - the user is just not returned. This makes life difficult for me, as I need to identify locked ...