java

Java Applet and Browser Freeze

Hello, Is there a best practice for avoiding a browser freeze when loading an applet? For my precise needs, the applet needs to be loaded when the web application is initialized, and is not a visual component (will be in a hidden div or hidden iframe). As a reference, here is an old bug on SUN's side. ...

Is there a way to use java.util.Preferences under Windows without it using the Registry as the backend?

I want to use the java.util.Preferences API but I don't want my program to attempt to read or write to the Windows registry. How would I go about this? ...

How do I get tomcat 5.5 to run behind apache 2 with mod_rewrite passing through requests to mod_jk and stripping app context?

Ok, so I want to get a webapp running in tomcat (5.5) to run behind apache 2 (2.2.3 to be precise) serving from the root of the site (i.e. without the context), with static content being served via apache. So if the app is running under "/myapp" on tomcat I want to use apache (plus mod_rewrite) to make it behave as if it's running under...

can i clean stacktrace?

i know that i can get stacktrace by using Thread.getAllStackTraces()(it returns Map, but clear does not work). When I run recursion method i can get exception because of stacktrace being too big, is there any way to clear it? ...

NoClassDefFoundError when trying to use JMockit Coverage

I am trying to use JMockit's code coverage abilities. Using the JVM parameter -javaagent:jmockit.jar=coverage=.*MyClass.java:html:: I am able to run my tests (jmockit.jar and coverage.jar are on the classpath), unfortunately my log file says: Loaded external tool: mockit.coverage.CodeCoverage=.*MyClass.java:html:: Loaded external too...

Struts JSP previous link

Hi, Does anyone know how I can retrieve the previous JSP URL that a page has come from within a JSP? Can I retrieve this from the session/ request/ response object? Hope this makes sense, Thank you ...

How to detect when an object is no longer referenced

Is there a way to create register a handler that will be called exactly at the time when the last reference to a certain object is released? An example would be an object that is backed by a physical data file and once the object become unreferenced, the file should be closed and than renamed. It would be nice if this was possible witho...

Java Media Framework on client side?

If I’m writing an applet that shows a video sequence (eg. streaming from a camera, or the applet itself is running the on the camera), do my clients need to download the Java Media Framework libraries inorder to see the sequence? ...

Does anyone know what happened to javaspec.org?

javaspec.org should contain a java-related wiki; but it seems down... Is this only temporary or is it down 'forever'? ...

How can I mount a windows drive in Java?

We are working with some legacy code that accesses a shared drive by the letter (f:\ for example). Using the UNC notation is not an option. Our Java wrapper app will run as a service, and as the first step, I would like to map the drive explicitly in the code. Has anyone done this? ...

Get privatekey from Keystore

Hi, I have the following code to export certs and keys from a keystore, that I created with keytool in windows: final KeyStore keystore = KeyUtil.loadKeystore("keystore.jks", "pass"); UserInfo userinfo = new UserInfo(WSusername, WSpassword); X509Certificate clientcert = KeyUtil.getCertificate(CLIENT_KEY_ALIAS, keystore); X509Certificat...

C# equivalent to java's wait and notify?

I am aware that you can lock an object in c# using lock but can you give up the lock and wait for something else to notify you that it's changed like you can in java with wait and notify? It seems to me that synchronised and lock in java and c# respectively are synonomous. ...

How can I generically tell if a Java Class is a primitive type?

Is there any way to take a Class and determine if it represents a primitive type (is there a solution that doesn't require specifically enumerating all the primitive types)? NOTE: I've seen this question. I'm asking basically the opposite. I have the Class, I want to know if it's a primitive. ...

java webservice client

Hello. I have stfw but I cannot find a simple / standalone way to create a webservice client in java. Does anyone have a link/sample into this? Thank you. ...

DevPartner's Metric Publisher

I am using DevPartner (for Java) with pretty good results. However, there's a "metric publishing" utility which I can't use. The problem is that said utility (pubmetrics.exe) asks for a site/port/user/password combination which I don't know. It pre-fills the site/port data with the localhost and thus I assume it's trying to contact the...

view SQL executed by Jasper report

Hi, When running a Jasper report in which the SQL is embedded in the report file (.jrxml), is it possible to see the SQL that is executed? Ideally, I'd also like to see the values that are substituted for each of the $P{} placeholders. Cheers, Don ...

What type should Struts ActionForm properties be?

I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a specific question regarding ActionForms. Some of them have only String properties (even for numbers), some of them use the seemingly appropriate types (Integer, Date, String, etc). What's the best practice here? Also, it seems that if a property is of type Intege...

How to deal with monstrous Struts Actions?

I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a specific question regarding Actions. Most of the pages have exactly one Action, and the processExecute() methods are hideous monsters (very long and tons of nested if statements based on request parameters). Given that Actions are an implementation of the command...

Why would you choose the Java programming language over others?

Why would you choose java over others? Why did you choose java to program your application? Please include what you are using java for (desktop application/ web application/ mobile). ...

How do I force/get to use GTKLookAndFeel in Java on KDE?

Hello First of all, using gnome is not an option (but it is possible to install its libraries). I need to know what is necessary to display a Java Swing desktop application using the current installed KDE look and feel of KDE. Ideally, the solution should allow me to apply a look and feel that looks like the underlying windowing system...