java

Which HTML tag is the proper one to use for Java applets (APPLET, EMBED, OBJECT)?

My understanding is that APPLET is deprecated and OBJECT is the preferred tag to use for Java applets. Is this correct? A lot of Java applet examples, both on the web and in books, still seem to use the APPLET tag. Are there any browser compatibility issues that OBJECT suffers from (compared to APPLET)? Also, can you provide an examp...

Making cut/replace methods with JTextArea

I am to make a cut and a replace method on JTextArea. I have the code for copy and paste, and I reckon I could just use that, in addition to just deleting the marked text in the JTA. How would the code for a code for cut and replace methods look like? The code for copy looks like this: public void copy(){ int start=ta.getSelection...

Auto-locating a client's server

FileMaker Pro has a feature that allows client applications to auto-locate their server's IP address and connect to it. What is the best way to do this using a general purpose language like Java or .NET? ...

read file from serial port java

Hi, I'm begginner in java, I'm writing ("FLASH").getbytes() like this to serialport. After I'll get FLASH_OK as response, again I've to send file request. After that I'll get response as FILE_OK then I have read file up to end of the file. I'm not getting how to do this process plz help me. Thanks for reply ...

Maximum size of data that can be fetched from a client socket using socketChannel of nio package in java

Using SocketChannel sc =(SocketChannel)key.channel();, we can fetch data from port into buffer. In order to receive the data continuously from port without the loss of data, how the code should be ? Here is my code import java.io.*; import java.net.*; import java.nio.*; import java.nio.channels.*; import java.util.*; public class Mult...

Hibernate: Collections of Collections

This is a problem I keep on running into: I would like to have hibernate manage a single table that represents a collection of collections. For example: a Map of Maps List of Sets Map of Lists Example, I would like to be able to represent this: class OwningClass { Long entityId; Map<String, List<Element>> mapOfLists; }...

How to Debug Java Application using VIM/GVIM?

I asked this question previously: http://stackoverflow.com/questions/495268/any-good-tutorial-for-moving-from-eclipse-to-vim From the inputs, I started using GVIM instead of Eclipse. I added ctags to it and I am able to navigate now comfortably. Only problem left for me is "Debugging"? I tried searching for some links, and couldn't a...

How to create an SSL connection using the Smack XMPP library?

I'm building a small program that acts as an XMPP client and I am using the Smack library. Now, the server I am connecting to requires SSL (in Pidgin I have to check "Force old (port 5223) SSL"). I'm having trouble getting Smack to connect to this server. Is it possible? ...

Was can be the cause of java.net.SocketException: recv failed: Insufficient buffer space?

A customer receive the error "java.net.SocketException: recv failed: Insufficient buffer space" on windows. With the netstat command we see only approx. 100 socket connections. I have change the MaxUserPort to 60000 like described at http://support.microsoft.com/default.aspx?scid=kb;EN-US;196271 I know that this Java error is equals to ...

The value for the useBean class attribute ... is invalid

I want to use a java file "SaveProp" which is written in a package "user". The class file has been placed in the WEBINF/classes.Below are the two lines which causes the issue. jsp:useBean id="user" class="user.SaveProp" scope="session" jsp:setProperty name="user" property="*" This is the code, but it throws, The value for the useBean...

Force JUnit to run one test case at a time

I have a problematic situation with some quite advanced unit tests (using PowerMock for mocking and JUnit 4.5). Without going into too much detail, the first test case of a test class will always succeed, but any following test cases in the same test class fails. However, if I select to only run test case 5 out of 10, for example, it wil...

el expression in jsp:invoke

I'm trying to use the following snippet inside my tag file: <%@ attribute name="content" fragment="true"%> ... <c:set var="part" value="content"/> <jsp:invoke fragment="${part}" var="partValue"/> ... and compiler gives me the following error: Syntax error, insert ") Statement" to complete IfStatement so as I understand it's not per...

Has anybody used JPA with Red5?

Hi! I'm developing a red5 application. I have to retrieve some data from the database and I want to use JPA to do this, preferably the toplink implementation? I know that red5 deploys application with Spring and I also know that I have to configure the red5-web.xml but I don't have any idea how to do this. Does anybody here know how t...

Should I keep instance variables in Java always initialized or not?

I recently started a new project and I'm trying to keep my instance variables always initialized to some value, so none of them is at any time null. Small example below: public class ItemManager { ItemMaster itemMaster; List<ItemComponentManager> components; ItemManager() { itemMaster = new ItemMaster(); components = new...

Book recommendation: JEE

Do you know a good book on this topic? ...

How can I send an SMS from Java?

i wanted to send SMS to particular mobile from webapplication and receive his reply and view to webapplication only.. is it possible to create using java technology if means give guidence..... pl ...

How can I have a batch file launched on a server from within Java?

Is it possible to allow a client to click a button, and then trigger a batch file to run on the server? I am able to run the batch file on the server from within server machine, but I want to run it on the server, but launched from the client machine from a website. How would I do this? ...

Exception occurs with JAX-RPC handler

I have some SOAP webservices build with JAX-RPC. These work fine. But as soon as I add a handler, I get an exception. When the binding is removed from the webservices.xml, everything works fine again. The weird thing is, the handler itself isn't included in the stacktrace of the exception. I also noticed, the init and getHeaders method...

Is it currently possible to build Eclipse Plugins by Maven AND have nice IDE Integration?

I'm currently evaluating maven to improve our build process. The building and creating of normal jar files works so far, although I'm not entirely happy with the Maven IDE. I'm now at that point, where all libs I need for our project are built, and I'm moving on to the Eclipse RCP projects. And now I'm not sure how to go on. There are ...

How to use Windows login for single-sign-on and for Active Directory entries for Desktop Java application?

I'd like to have my desktop Java application to have single sign on related to Active Directory users. In two steps, I'd like to : Be sure that the particular user has logged in to Windows with some user entry. Check out some setup information for that user from the Active Directory With http://stackoverflow.com/questions/31394/java...