java

Where is the Groovy/Grails support in NetBeans?

After repeatedly hearing good things about the Grails support in NetBeans and being frustrated by eclipse's lack thereof, I've decided to give it a try, but now said support doesn't seem to exist: I've downloaded the bunde containing NetBeans 6.7 along with the latest Java 5 JDK from Sun The About box says: NetBeans IDE 6.7 (Build 2009...

Scalable ruby application

I am java developer and heard a lot about ruby. My real question is can we develop large scale enterprise (web) application in ruby ? Because I heard that ruby is good for small application, but like java we can't develop large scale scalable (web) application in ruby. ...

Java NIO: reading variable-sized blocks

I would like to read a string from a TCP stream that is given with a byte length followed by the actual data. In Python, I would do length = ord(stream.read(1)) data = stream.read(length) How do I do the same in Java NIO? What I have is a buffer (of capacity 257) stream.read(buffer); // cannot specify a size here int length = buffer....

Java BigDecimal remove decimal and trailing numbers

Hello all, I'm new to Java and trying to take a BigDecimal (for example 99999999.99) and convert it to a string but without the decimal place and trailing numbers. Also, I don't want commas in the number and rounding is not needed. I've tried: Math.Truncate(number) but BigDecimal is not supported. Any ideas? Thanks very much. ...

Lots of browser tabs with java applet causes OutOfMemoryException

I have an applet that consome quite a lot of Memory. If a user opens multiple tabs with a webpage that has the applet, they get an OutOfMemoryException. This can be explained by the fact that browsers use just one instance of a virtual machine. Is there any way I can prevent this? The OutOfMemoryException can't really be caught, since i...

Name 2 java VM threads

Hey, I am studying for a java exam and on a past exam the lecturer asked this question and im wondering if someone can help me. "In the context of java explain threads. Give an example of when you might use a thread. Name two java virtual machine threads." The first two parts of the question are easy enough but the part about naming th...

Calling EJB in JBoss from Tomcat & passing an object as an argument

I have the following EJB class instantiated in an application running in JBoss 5 public interface ISlaveServer { public String getId(); public String getName(); } @Remote public interface IMasterServer { public String getId(); public void addSlave(ISlaveServer slaveServer); public void removeSlave(ISlaveSe...

Overlapping line segments

The following diagram illustrates a problem I have encountered creating a Manhattan diagram: Overlapping Lines The box surrounds most of the line [(tx,midy)-(sx,midy)] that has overlapped an existing line (represented by psegment in the code below). I have removed the overlapping arrow heads (and tails) and am a little stumped on how t...

Hibernate "could not execute query" Exception!!

exception javax.servlet.ServletException: org.hibernate.exception.GenericJDBCException: could not execute query org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) org.apache.struts.action.ActionServlet.doGet(A...

Spring can't see my imported classes

My controller (abstract controller) is calling a service class to get a URL. In my service class I instantiate my dependency in the constructor: the abstract controller: public class MyPageController extends AbstractController{ private UserService userService; private LearnerService learnerService; private TwitterService twitterServic...

Looking for an open source IDE supports Struts 2.x.

Currently I am using struts 1.3 netbean 6.7. I have googled for struts 2.x support for netbeans unfortunately I didn't got. My question is "Is there any open source IDE supports struts 2.x?". ...

org.apache.velocity.exception.ResourceNotFoundException

Hi All, i am using velocity engine template for mailing in struts1 and hibernate configuration. i got error : org.apache.velocity.exception.ResourceNotFoundException while i try to send mail. i have included velocity1.5.jar, mail.jar, activation.jar, smtp.jar. i include the velocity template path here String velocityTemplate = "mail...

Save image file with dialog using java

does anyone know how to save a file image with previously show a dialog to choose where the location is and input a name of the file? thanks for your response, appreciate it ...

Notify minimised window of an event occurrence in an applet

Hi, I have a JApplet which is used for chat. I would like to make it possible that when the applet is minimised and a chat message is received by the user, the minimised window becomes orange (and thus shows the user that something has occurred). How is it possible to make the applet do this? Thanks, Tim ...

Dynamic HTML Table rows added and filled and inserted in to databse

I needed a solution , to implement adding dynamic HTML table rows and filling them with details , the rows should then be added to database on submit. what is the best way to implement this in jsp.The jsp page on load get the data from the database and creates rows, i can edit the row values and it should be updated,also new rows can be ...

google talk java api support voice chat

I Have to write a google talk client & now I want to write voice chat for this . I'm using smack api from ignite realtime . I've tried the smack jingle that is based on standard jingle but it won't work with google talk . VoiceClearly offers a free Java API for Google Talk that support voice and chat , but it doesn't release this API sou...

hidden watermark

Possible Duplicate: http://stackoverflow.com/questions/397537/adding-an-invisible-image-watermark-in-c hi all, i've been trying to solve how to insert a hidden watermark to JPEG image using java. and i'm stuck and desperate, i havent found any solution just yet has anyone tried it? if yes, please share, thanks very much ...

Java Stringparsing with Regexp

I try to parse a String with a Regexp to get parameters out of it. As an example: String: "TestStringpart1 with second test part2" Result should be: String[] {"part1", "part2"} Regexp: "TestString(.*?) with second test (.*?)" My Testcode was: String regexp = "TestString(.*?) with second test (.*?)"; String res = "TestStringpart1 wi...

Anyone know web provide free web hosting for Web Service Java?

Anyone know web provide free web hosting for Web Service Java? I learning how to make WS, and i want to test it online. i heard if want to hosting WS , must web can java support. note: yes, i have try in localhost and it's working. so i want to test it online ...

How to use java property files?

So I have a list of key/value pairs of configuration values I want to store as java property files, and later load and iterate through. Questions: Do I need to store the file in the same package as the class which will load them, or is there any specific location where it should be placed? Does the file need to end in any specific ext...