java

Python - List of Strings to Java

Hi, I'm getting a list of strings from python code and need to read it in Java. When trying to read it, i get the hashCode [Ljava.lang.Object;@7cf1bb78 I want to read the values in a list. In python my return is something like return SUCCESS(OK, params={'data':nameList()}) How would I read this in Java and print the contents no...

java GUI programming tools?

Hi , which is one is the best java GUI generating tool NetBeans Jigloo Please suggest me if you have any other choices. I need the following functionalities: Drag and drop feature able to add code manually after some point of time code readability need to rename variables. ...

JAXWS serves only 100 requests, how to configure JAXWS to change it to unlimited?

Hello, I'm using JAXWS for generating webservices and serving using EndPoint.publish() as well as deploying war file, but as soon as it has served 100 requests it wouldn't return 101st response. How to configure JAXWS to change this count to unlimited? EDIT: solution found, first of all it was not related to JAXWS and I'm sorry for pos...

Type of template if the template is the return value (Java)

I was wondering what is the data type of the template variable if the return is set to a template. I have seen this in a code somewhere but I do not know where does it cast the value retrieved from the session. public class RequestObject { public <T> T getFromSessionMap(String sessionKey) { return (T)session.getAttribute(sessio...

Multipart email message

How to use html tags in a multipart email message. When I use <b> its not recognized as the bold tag. ...

How much timeout to use in isValid()?

Hi. In the method from Connection, how much timeout should I give it? :S I have no idea what a normal timeout would be, how much time should it take? :) I dont want isValid() to return false if it could return true if it had gotten more time, but also I don't want it to slow down the whole program and give me "freezes". If I set 0, d...

How can I measure the execution time of a for loop?

I want to measure the execution time of for loops on various platforms like php, c, python, Java, javascript... How can i measure it? I know these platforms so i am talking about these: for (i = 0; i < 1000000; i++) { } I don't want to measure anything within the loop. Little bit modification: @all Some of the friends of mine a...

ContextLoaderListener problem while spring is loading up

When my spring is loading up, it says applicationContext.xml is not found in the classpath by throwing FileNotFoundException as can be seen below. Please help me resolve this problem. my web.xml content is as follows, <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.or...

How java.io.Buffer* stream differs from normal streams?

How buffered streams are working on the background and how it actually differs and what is the real advantage of using the same? Another Query,.. Since DataInputSytream is also Byte based, but it is having methods to readLine().. Whats the point in here ...

Passing request object to different servlet/action of same application running at different servers

Hi I have one application running on different servers build in struts2 and deployed in Tomcat5. Now I have a functionality of "Save on All" in this application. When it is called, then the same request parameters need to be passed to all the servlet/action of all the applications running in all the servers. How can this be done? E.g....

How can I bind an (outbound, of course) HttpUrlConnection to a specific local ip address, when I have multiple NIC on my client machine?

I have a kind of Http-Gateway app, which acts as an http client towards servers outside our local network. There is going to be a network configuration upgrade, and I'm going to have problems because: - there are multiple network cards on client machine - firewall/nat rules use hardwired ip addresses If I could programmatically for...

EL expressions won't executed in Tomcat 5.5, but working in tomcat 6.0.20

Hello All... I am developing my application using spring-web-mvc... Now at my Controller it returns like this : public class InterfacesManageController implements Controller { public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> myModel = new Has...

JavaCC Problem - Generated code doesn't find all parse errors

Just started with JavaCC. But I have a strange behaviour with it. I want to verify input int the form of tokens (letters and numbers) wich are concatenated with signs (+, -, /) and wich can contain parenthesis. I hope that was understandable :) In the main method is a string, which should produce an error, because it has one opening but...

Java JNI stackfall prevention

I use Java JNI with Gdal. There are some server side applications built on top of the JNI bindings. The whole JVM stackfalls if there is an error in the JNI section. What's the best way of testing that a c/c++ library does not contain fatal errors which will cause JVM stackfall ? What is the best practice to cleanly deal with errors whi...

Size of reference of an class in JAVA

What is the size of reference of a class in Java? Is it constant for a particular JVM and OS irrespective of the class for which the reference is made. Class A Class B Class C A a; B b; C c; Is size of a , b and c are same irrespective of the size of A, B and C classes? ...

Access Outer Class this instance

how do we access outer class this instance: eg in Class A { Class B { this.helloB(); (A's this).hello() } } how do we access A's this instance in Java ...

Should I use (non-blocking) NIO for UDP?

According to this post, UDP just doesn't block. Are there any advantage using the (non-blocking) NIO API for UDP? Or should I just use the easier "traditional" io API? ...

Getting package-level access to a field from outside the package?

I'm using an API that has an abstract class that I wish to extend (in my concrete class) in order to take advantage of some methods within the parent. Unfortunately, the programmer of that API class decided with one field in particular to give it package-level access with no public setter. The field value is instead set within a method. ...

ways to add invisible components into JPanel ?

Hi , I need to add some invisible component into a JPanel to avoid the issues with grid bag lay out.Which is the best way to add these kind of invisible components? ...

what is the difference between onClick and mouseClick?

wondering what is the major difference between these two: onClick and mouseClick.. ...