java

Bluetooth SPP from Adobe Actionscript (Flex Framework), how?

I am successfully running Bluetooth-SPP applications relying on http://bluecove.org/ That is Java to Java. I do now want to establish Bluetooth-connectivity in an Adobe Flex-application. Anyone has experience, ideas? I appreciate your advise. Thank you Bart ...

Injecting an object into a HttpSessionAttributeListener via Guice ?

Configuration: Guice 1.0, Apache Tomcat 6.0 I am currently manually injecting objects configured in a Guice Module, into my servlet, using this method: public void init( ServletConfig config ) throws ServletException { super.init( config ); ServletContext sc = config.getServletContext(); Injector injector = (Injector) sc ...

Reading a file and editing it in Java

Hi, What I am doing is I am reading in a html file and I am looking for a specific location in the html for me to enter some text. So I am using a bufferedreader to read in the html file and split it by the tag . I want to enter some text before this but I am not sure how to do this. The html would then be along the lines of ...(newText...

Access to Facebook API using REST and HttpClient

Hello there, I am going to use RESTful Web Services and HttpClient to access Facebook API REST Server. Am somewhat of a newbie to REST and Facebook APIs... Question(s): Verification / Authorization (1) If I have a session key sent by a client app, how do I verify and authenticate that the user exists and then query for his / her fri...

Selecting a good Framework for web-development

Based the accepted answer to this question I've setup a NetBeans/tomcat environment. In testing this setup I'm trying to create a Java Web/Web application, but is stumped by the a choice of frameworks for this test-app. The choices are: Spring Web MVC 2.5 JavaServer Faces Struts 1.3.8 Hibernate 3.2.5 In my reading-up (googling & SO...

Handle a software programatically using java

I want to know that can we operate a simple software using java programming...i.e. if we know already what r the buttons there and what will be the flow after clicking any button, then can we programatically handle the flow? ...

Function to Sanitize HTML Id attribute in Java

I have coded the next function. But surely someone has a more elegant way to perform this task. /** * * HTML 4 Specification * ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number * of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). * @param s * @re...

CXF and when should I use JaxWsProxyFactoryBean or JAX-WS Proxy

Hi when I should use JaxWsProxyFactoryBean and when I should use Java stub generated from wsdl or JAX-WS Proxy? Are there any advantages or disadvantages? thanks ...

Java Date vs Calendar

Could someone please advise the current "best practice" around Date and Calendar types. When writing new code, is it best to always favour Calendar over Date, or are there circumstances where Date is the more appropriate datatype? ...

synchronization in java

Here is simplified version of my requirement I have a java class say Processor that contains a method say bigProcess() all it does is connect to a file server, download a specified file once that is done save the file in DB and after that update some of the DB fields in different tables. For each of the subtasks like download file, sav...

Eclipse Modelling Framework (EMF): How to get the DomainModel from a Magicdraw UML2 Export

Hi, I want to use the EMF for Code Generation, so I wrote some methods to load my UML2 File which I generated myself. This works fine with the following code: protected void registerResources() { resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE); resourceSet.getResourceFactoryRegistry().getExtensio...

Using Java to change xml to html

Hello, I am using java code to create a html document. I have an xsl stylesheet and some xml that I want to create the html from. I am using the TransformerFactory method to do this. My problem is that when it creates the html file, when you open it you see a blank page but the code is there. The issue is that when the html is created ...

java to c# how to do custom painting in a panel

hello, in java when you want to do custom painting in a panel, you usually override the paint() function. now i am looking for the corresponding function to override in a C# panel. also i would be thankful for a short samplecode to do some painting. like draw a circle or something. thanks a lot! edit: ok thanks for your answers! i h...

how to retrieve the userLogin id in java

i need to retrieve the User login ids who is logged on the server. I want to do it in java. If anyone who have the code please explain with the same. Thanks you. ...

Sametime Plugin Development Using Eclipse 3.5 and ST 7.5

I have been trying to setup a Dev environment for Sametime Plugin Development for a week now but I am facing issues in one form or the other. The issues that I am facing are After setting up the Env, the extension point schemas are missing and i am getting only the word "Generic" instead of the actual extension. The above issue made me...

Appropriate use of a ServletContextListener in Java / Apache Tomcat web application

Hello Can anyone tell me if it is appropriate to use a ServletContextListener for a particular requirement? What I have is a web application which runs a particular job every hour to poll a number of RSS feeds and at any time a user can define a new RSS feed for polling. What I want to avoid is a user adding a feed(s) during a curre...

Can I add Java portlet in sharepoint 2007?

Can I add Java portlet in sharepoint 2007? If yes, can some please explain the details on how can I do so? ...

learning resources for mockito please..

i am required to use mockito to create unit testing framework for existing code. I am unable to find a good place to get started with learning Mockito. Could you please point me to a good learning resource for mockito? (online resource or otherwise) ...

hibernate mapping file without all properties

I have a database containing approx. 200 tables. I use jboss-ide to automatically generate hibernate classes from the database using the File->New->Other->Hibernate->Hibernate Mapping file wizard of jboss-ide 1.6. the problem i'm facing is that the .hbm.xml file generated does not contain all the propertiese it's supposed to. what's als...

Why is String the only class for which literals exist in Java?

Why is java.lang.String the only class for which two ways of creation exist: 1) With normal way with "new" keyword. String s = new String("abc"); 2) With String literal (which is only available with String class) String s = "abc"; So why are there String literals and no literals for any other classes?? ...