Detect a new network connection (linux-server) and it's status in java
Is there any way that java can detect that I have just plugged in a wired-network, and monitor it's bandwith? (I'm using linux, if that matters) ...
Is there any way that java can detect that I have just plugged in a wired-network, and monitor it's bandwith? (I'm using linux, if that matters) ...
Something that's confused me - an example: Thing.java: import java.util.Date; class Thing { static Date getDate() {return new Date();} } (same package) TestUsesThing.java: // not importing Date here. public class TestUsesThing { public static void main(String[] args) { System.out.println(Thing.getDate().getTime(...
Hi, I need to create some reports, in different formats (xls, pdf, rtf). I am currently using JasperReports, in conjunction with IReport. I have no major complaints about it (except for the cases when IReport messes up my xml files), but i've been having some problems with it, when exporting to xls files and with some "special" character...
I'm trying to generate a client for some SOAP web services using the JDK 6 tool wsimport. The WSDL was generated by a .NET 2.0 application. For .NET 3.X applications, it works fine. When I run wsimport -keep -p mypackage http://myservice?wsdl it shows several error messages like this: [ERROR] A class/interface with the same name ...
I want to run a .jar file on my Nokia N73 phone. I cannot figure out what I need to do this. I have downloaded the Sun Java Wireless Kit but that just connects to its own emulators. ...
Currently I am doing automated integration testing using FitNesse (Java) and have successfully plugged-in Watij to access a web-based application. I would like to extend this to also drive Windows GUI (non-Java) applications. To this end, are there any Java libraries available which I can use in a similar way? ...
I have a method which loops over user elements, and sets a boolean value according to some given constraint: public void checkUsers( int constraint ) { for(int i=0; i<nodeUsers().size(); i++) { UserElement elem = nodeUsers().getUsersElementAt(i); switch (constraint) { case CHECK_ALL: elem.set...
I'm trying to consume a .Net 2.0 web service using Axis. I generated the web services client using the Eclipse WST Plugin and it seens ok so far. Here the expected soap header: <soap:Header> <Authentication xmlns="http://mc1.com.br/"> <User>string</User> <Password>string</Password> </Authentication> </soap:Header> I didn'...
I am using the maven-ear-plugin version 2.3.1 - I know there is a new version available: http://maven.apache.org/plugins/maven-ear-plugin/ I can't work out how to upgrade to the latest version?? ...
Hi all, This is my first Q here :) I recently have taken the support and programming of a web system written in JSF. The code is kind of messy and redundant, and yes, no documentation exists. The system has over 40 jar libraries, and most of them are redundant due to old versions and testing. To remove one jar, I must check that it...
I need to determine if an image exists in a JSP tag so I can display a default if it doesn't exist. What is the best way to access the War root so that I can check to see if the image exists? Or is there a better solution? ...
In this code : public class MyClass { private Object innerValue; public Object getInnerValue() { return this.innerValue; } public void setInnerValue(Object innerValue) { this.innerValue = innerValue; } } public class MyClassReadOnly extends MyClass { MyClassReadOnly(MyClass cls) { // Mak...
Hi, I'm currently evalutating Struts 2. The official documentation contains a HelloWorld example with the following Java and JSP code: Java import com.opensymphony.xwork2.ActionSupport; public class HelloWorld extends ActionSupport { public static final String MESSAGE = "Struts is up and running ..."; public String execute(...
I wish to learn about developing an editor for Eclipse for a particular programming language. Is there a tutorial available to help me with this? It would be beneficial if it covered such topics as syntax highlighting and auto-completion. ...
I have the following inner class: @Entity @Table(name = "SATTET0") public class SATTET0Key { @Column(name="IESTATUT") public String estatut; @Column(name="IINICIO") public Date dataInicio; } In the same class i have the following code: Query q = exp.createNativeQuery("SELECT IESTAT...
I used to run Tomcat separately on my machine. I had an Ant script that would rebuild my project, deploy it locally, and restart Tomcat. That all worked ok, but I wasn't able to debug the web app inside Eclipse. So I learned how to setup Tomcat inside Eclipse and got my web app running. Now the problem is that I don't understand fu...
I would like to be able to compute the set of all characters which may be matched as the first character in a string by a given instance of java.util.regex.Pattern. More formally, given the DFA equivalent to a certain regular expression, I want the set of all outgoing transitions from the start state. An example: Pattern p = Pattern.c...
I was just wondering if a DateField can be set by a String value. Would help me out thanks. ...
In another Bruce Eckel exercise, the code I've written takes a method and changes value in another class. Here is my code: class Big { float b; } public class PassObject { static void f(Letter y) { y.c = 'z'; } //end f() static void g(Big z) { z.b = 2.2; } public static void main(String[] args ) { Big t = new ...
How do I, without annotations, create and wire a controller that will perform an action based on a query parameter? So maybe I've got a page with a list of items on it, and each one is a link like "edititem.htm?id=5". When the user clicks a link I want the controller to load up "item #5" and pass it to my edit form. I'm sorry to ask ...