java

j2ee input output stream

i want to creat a pipe between clint browser<->my server <-> some other server .For downloadin some file. I am using apache tomcat as my server. How can i create the pipe via my server ? i dont have mucg space on my server . So i dont wan to save files on my server .I just want the download data to go via my server due to some reasons....

Launching activities within a tab in Android

Here's the deal. I have an application with three tabs. Through various interactions with the items in the tabs I end up launching other activities. The client has reviewed this and would like the activities launched "within" the tabs, so the tabs remain visible and if the user clicks the tab it goes back to the original activity defined...

Way to get number of digits in an int?

Is there a neater way for getting the length of an int as this? int length = String.valueOf(1000).length(); ...

Which is better/more efficient: check for bad values or catch Exceptions in Java

Which is more efficient in Java: to check for bad values to prevent exceptions or let the exceptions happen and catch them? Here are two blocks of sample code to illustrate this difference: void doSomething(type value1) { ResultType result = genericError; if (value1 == badvalue || value1 == badvalue2 || ...) { resul...

Create navigation menu dynamicly based on deployed jars.

Hi, I am just investigating the idea of this so have no example code. I've been digging around on the web but I'm not really sure what I should actually be looking for so I'm not finding much. So I thought I'd ask and see if anyone knew if a) This is possible. b) How I should do it. (Or at least what I should be looking to learn about t...

Can I set a timer on a Java Swing JDialog box to close after a number of milliseconds

Hi is it possible to create a Java Swing JDialog box (or an alternative Swing object type), that I can use to alert the user of a certain event and then automatically close the dialog after a delay; without the user having to close the dialog? ...

export/import Eclipse build path

I like Eclipse's build path features, but would like to keep it in sync with my ant build.xml. Is there a way to either automatically import the Eclipse build path from a text file, or export the Eclipse build path to a text file, so I can use that file from ant? (if I can get to a text file, I know I can figure out how to get ant to use...

Add Jar to Runtime Path for JSP

I'm using IBM's Rational Software Architect (essentially Eclipse I suppose). I have a JAR file that contains Proxy classes to access a Web Service (JAX-RPC). I've created a Dynamic Web Project with a simple JSP page in which I'm trying to consume the Web Service using a Proxy class from this library. Code from the JSP page: <jsp:useBean...

Can I import codestyles into Netbeans?

I have tried NetBeans for some time, but have not made my final move yet. I need to be able to import codestyle settings from Idea or Eclipse. Anyone know it that is possible? Or if some plugins allow that? ...

Purpose / importance of the file modification date methods in Lucene's Directory?

I've built a Lucene Directory implementation for jdbm, an embedded Java database. Part of the Directory API are two methods related to "file" modification dates: touchFile and fileModified (javadoc). My question is, what is the purpose of these methods? I've searched the entire Lucene core source tree, and found no usage of these meth...

Should ibatis domain class be used as javabean?

I have a table category mapped to domain class Category using iBatis. Should I use this class as a JavaBean? The bean for product should have other attributes such as number of products in this category. These attributes are not part of the domain class Category. If i use Category as bean class, is it still relevant? Is it better to prov...

jBoss 4.0.2 deploying same WAR multiple times causes jBoss to crash because of PermGem/Out-of-Memory Errors

I develop web applications and I use jBoss 4.0.2 and when I have redeployed my WAR several times with eclipse, jBoss will crash because it runs out of memory. And when I have to install new version to production enviroment, it will consume production servers memory, so that means I have to stop jBoss to prevent redeploying eat memory fro...

Java Applet fails to load with MSJVM

We have a web application that uses a third party java applet for encryption and authentication. It's always been a bit finicky, but right now it has me pulling my hair out. Over the weekend, we migrated to a MS Load balanced cluster, upgraded our DNS, and rolled out all of the MS patches. Now the applet fails for all of our users who...

How can I run cygwin from Java?

I want to start nutch from Java. How can I start cygwin from a Java program? ...

Change status line in InstallAnywhere

Howdy, During the installation of our product I have a Merge Module that might have to install .netFramework3.5, Windows Installer 4.5 and SQL Express 2008. This process take about 15 minutes. Is there a way to change what is being displayed on the InstallAnywhere 2009 install dialog when it is running a Merge Module? Thanks -Pete ...

Access Other Java Processes

Hi, I am writing a program that starts another java process which runs certain code. Is there any way I can "talk" to that process to call methods of the running class(es)? ...

How do I determine if java connection pooling is working with URLConnection ?

As can be seen in this document, a number of preconditions have to be met before TCP connection pooling "works" in java when using URLConnection. How can I determine if the connections are being pooled ? Are there any objects I can inspect in the sun jdk for this ? ...

Java: How to get a class object of the current class from a static context?

I have a logging function that takes the calling object as a parameter. I then call getClass().getSimpleName() on it so that I can easily get the class name to add to my log entry for easy reference. The problem is that when I call my log function from a static method, I can't pass in "this". My log function looks something like this:...

PHP Communicating w/ Java program

We're come across a problem here at my company and I'm trying to find the best solution. Software was recently purchased that utilizes a Java program to get the tax for a certain shipment. The site that needs this was written in PHP4. How can I communicate between the two? It was suggested to use files to communicate but that was h...

Restricting Java maven plugin configuration parameters

Hi, I’m writing a maven plugin with a number of configurable parameters. There are a number of parameters specified in the Mojo class. One of these parameters is required and must contain certain values (let’s say, either ‘Atwood’ or ‘Spolsky’). At the moment it is annotated with a. @required field as shows here: public class Generat...