java

Query Windows Search from Java

I would like to get to query Windows Vista Search service directly ( or indirectly ) from Java. I know it is possible to query using the search-ms: protocol, but I would like to consume the result within the app. I have found good information in the Windows Search API but none related to Java. I would mark as accepted the answer tha...

Why doesn't Java have constants for well-known system property names?

The java.lang.System class defines a number of well-known properties. For example, you can obtain the JVM's temporary directory by looking up the "java.io.tmpdir" property: ... = System.getProperty("java.io.tmpdir"); What I don't understand is why these properties aren't defined as constants (e.g. in the java.lang.System class). This...

WhiteSpace Form TextBoxes

Hi, I am repopulating a form field that a user previously filled out with Sessions in HTTP. I am grabbing the fields from the form through a servlet: //On servlet String polyNum = request.getParameter("policyNum") session.setAttribute("policyNum", polyNum); //On JSP * Policy #: "> The Problem: When I run my JSP page, I get a leading ...

Running corba project in Netbeans with corba compiler vbjc

Hi I am doing a small assignment in Corba using java. I am using netbeans ide for this purpose. In order to compile and run i need to compile and run with commands vbjc and vbj. I can do it by command line but for that i have to remove all the package declaration which is painfull. Can any one help me with this as it will speed up my ...

More than one implementator of an interface. How with OSGi ?

I am interested in using OSGI as a means of managing plugins for a project. That is there can be many implemenators of my interface, each appearing in its own / separate OSGI bundle with the implementation class exported... ...

Custom about dialogs in Eclipse applications

Hi, I have an Eclipse workbench application composed of many plugins. I'd like to set the about text of the app to reflect the build number. There seems to be a couple of places to do this: - Inside the application's .product file (setting text here doesn't seem to do anything?) - Inside the plugin.xml file of the main plugin (thi...

log4j - trigger log rolling when application starts

With log4j, I want the behaviour of the DailyRollingFileAppender so that date-pattern based log rolling can occur when an application starts up. BUT once the application has started, I don't want it to do any automatic log rotation until the next time the application restarts. How can I configure log4j to do this? ...

Recommended open source java mailing list software

Can anyone recommend a based open source mailing list software ? The following would all be desired if possible: Java as the underlying language, as we have people who are experienced with Java Something which is packaged as a war and can be dropped into a Tomcat server A sleek interface Underlying data should be reasonably transpare...

read and write method for large data in socket communication does not work reliably

I have created a socket programming for server client communication. I am reading data using read(byte[]) of DataInputStream Also writing data using write(byte[]) of DataOutputStream. Whenver I am sending small amount of data my program works fine. But If I send a data of 20000 characters and send it 10 times then i am able to recieve t...

What is this notation called ?

Class names can be abbreviated as follows: CustomerService => CS CustomerPaymentService => CPS UnpaidBillRetriever => UBR FindAnyRemainingOpenUserTrasactions => FAROUT This is supported by control-N (idea) or control-shift-T (eclipse). After some initial re-learning I now use this naming strategy heavily. But what is it called ? ...

how to sort hash map

how we will be able to sort a hashmap i want so sort in the basis of a value in array list... thanx in advance.............. ...

java.io.IOException: Invalid argument

Hi I have a web application running in cluster mode with a load balancer. It consists in two tomcats (T1, and T2) addressing only one DB. T2 is nfs mounted to T1. This is the only dofference between both nodes. I have a java method generating some files. If the request runs on T1 there is no problem but if the request is running on node...

How can I extend Java code generated by JAXB, CXF or Hibernate tools?

With generated Java source code, like code generated with Hibernate tools code generated with JAXB schema binding (xjc) code generated with WDSL2Java (cxf) all generated classes are "value object" types, without business logic. And if I add methods to the generated source code, I will loose these methods if I repeat the source code g...

How to disable Back button in IE and firefox?

Duplicate: Disabling Back button on the browser Prevent Use of the Back Button (in IE) I have to disable back and forward button of browser ( IE and Firefox both ). I have tried: //disable back button window.onbeforeunload= function() { } window.history.forward(1); but this works only in IE. Is there any foolproof so...

How are weak references implemented?

I wonder how weak references work internally, for example in .NET or in Java. My two general ideas are: "Intrusive" - to add list of weak references to the most top class (object class). Then, when an object is destroyed, all the weak references can be iterated and set to null. "Non-intrusive" - to maintain a hashtable of objects' poin...

How would i program a dynamic menubar in Swing?

Basically i want to be able to allow the user to save bookmarks which are then put into a list on a submenu on a menubar. How would i go about programming a general function for any number of bookmarks that may be added, i basically want the items to put the URL into a textbox when clicked. Would i need to create a new class for this, or...

Problem validating against an XSD with Java5

I'm trying to validate an Atom feed with Java 5 (JRE 1.5.0 update 11). The code I have works without problem in Java 6, but fails when running in Java 5 with a org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xml:base' to a(n) 'attribute declaration' component. I think I remember reading something about the version...

Java Socket program can not read data if the server sends data using write and recieves data using readUTF()

I have written a socket program where the client uses readUTF() and writeUTF() to communicate with the server while the server uses read and write() to communicate with client. Actually My server can read all the data coming from server. But as I am using write() in server side and readUTF() in client side. So In this scenario My Client...

Java class question

class One { public One foo() { return this; } } class Two extends One { public One foo() { return this; } } class Three extends Two { public Object foo() { return this; } } public Object foo() { return this; } throws a compilation error. Why is that? Can someone explain why "Object" type is not possible? Is Object the base class of C...

Matlab / Java API callback

I'm designing an API (in Java) and expect to have users accessing the API from Matlab. The problem is that I want the API to provide a piece of functionality like: javaApi.waitUntilPredicateIsTrue(Predicate<JavaObj> test); My API (in the background) gets hold of instances of Java Obj (via some mechanism, e.g. polling). I want this API...