java

Can one validate marshalled XML with JAXB 2.0?

Apparently in version 2 of JAXB - the validator class has been deprecated - does this mean the marshaller is automatically validating your XML? If so it doesn't seem to be complaining about some of the incorrect XML I am forming! Can anyone give me some advice on how I can validate marshalled XML to make sure it conforms to the XSD sch...

C# what does the == operator do in detail?

in c# what does exactly happen in the background when you do a comparison with the "==" operator on two objects? does it just compare the addresses? or does it something like Equals() or CompareTo() ? PS: what about the "==" operator in java? does it behave the same? ...

How to implement SAML SSO

How is SAML SSO typically implemented? I've read this about using SAML with Google Apps, and the wikipedia entry on SAML. The wikipedia entry talks about responding with forms containing details of the SAMLRequest and SAMLResponse. Does this mean that the user has to physically submit the form in order to proceed with the single sign o...

nextLine() not working after a for loop

Does any one know why my nextLine() not working after a for loop? It's always skip the nextLine() and go direct to the if statement. See below for more details int[] a = new int[3] for(int i=0; i<3;i++) { a[i] = nextInt(); } String b = nextLine(); if(b == "go") { ....... } else { ..... } ...

Impact of SSO on session time out

I need to implement SSO between a windows domain and a J2EE web appliction. I've been thinking what the impact of this would be on the web application's session timeout. We have a 2 hour time out. If we implement a seemless SSO, then I think it might become confusing for the user. The SSO will make it appear that the web application i...

Generating and visualising a decision tree

Hello I wonder if anyone is able to help or advise with the following; I have to be able to take data from a data source and to be able to visualise that data as a decision trees on a web page all. This will be a single process which is seamless to an end user. This will be done using JSPs and Java servlets but what concerns me are the...

CXF & SSL: Timeout Troubles

Hi all, I've got the following code that I am trying to use to access a webservice via HTTPS using Apache CXF. But whenever my message goes out, I get nothing back until my code times out. Can someone give my code a once over and let me know if I'm doing anything wrong. I've tried to access the service via SoapUI and that's fine, so ...

Implementing Event-Generator Idiom in Java

I'm trying to implement the Event Generator Idiom (http://www.javaworld.com/javaworld/jw-09-1998/jw-09-techniques.html). I find things to be a bit "odd" when it comes to the observable class though. Let's say I have the following classes: interface BakeryListener + orderReceived(BakeryEvent event) + orderProcessing(BakeryEvent even...

Transformation error: "The current event is not START_ELEMENT but 2"

Similarly to an older post I'm trying to access a web service with JAX-WS using: Dispatch<Source> sourceDispatch = null; sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD); Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req))); System.out.println(sourceToXML(result)); where:...

introduction to swt with out drag and drop designer?

I'm interested in writing a small Java application using SWT. I'm a blind individual though so can't use the tipical drag and drop controls in an IDE approach. Pointers to an introduction of SWT with examples in creating interfaces through code would be appreciated. ...

Avoid looping xml in jstl

I would like to do something like this: <x:out select="$productXML/product/sizes/size[<c:out value='${param.sizeIndex}'/>]" escapeXml="false"/> but I think the only way to do it is like this: <x:forEach var="size" begin="${param.sizeIndex}" end="${param.sizeIndex+1}" select="$productXML/product/sizes/*"> <x:out select="$size" e...

How can I stop using a mouse while programming in my IDE?

I love using an IDE, because I get some great productivity gains. However, I have a couple reasons to stop using a mouse with an IDE: To code faster - It definitely slows down my coding when my typing is interrupted with all of the constant point and clicking. To relieve pain - I've never had pain from the keyboard, but I get tendinit...

Which is the best ajax framework for java web development ?

I am using struts2 for my java web application . Now I want to use ajax for my client side user interface can anyone suggest me which is the best one to learn and implement ajax framework . I have seen jmaki , dojo , jQuery and heard about vroom for netbeans IDE thanks in advance . ...

Strut2 validation, Overriding css_xhtml theme

HI Folks, I'm using the Struts 2 validation. And for displaying the custom error messages I'm overriding the css_xhtml.. and the validation.js for client side validation. Every thing is going well but the validation is on form submit.. can i do it for all the form fields Onblur event.. Any suggestion highly appreciated Thanks in Adava...

How do I implement task prioritization using an ExecutorService in Java 5?

I am implementing a thread pooling mechanism in which I'd like to execute tasks of varying priorities. I'd like to have a nice mechanism whereby I can submit a high priority task to the service and have it be scheduled before other tasks. The priority of the task is an intrinsic property of the task itself (whether I express that task ...

How do I detect which kind of JRE is installed -- 32bit vs. 64bit

During installation with an NSIS installer, I need to check which JRE (32bit vs 64bit) is installed on a system. I already know that I can check a system property "sun.arch.data.model", but this is Sun-specific. I'm wondering if there is a standard solution for this. ...

In Java5, how do I get the full name of the user running the application?

In Java5, is there a way to get the full name of the user that is running the application using only JDK APIs? (I know about JAAS and third-party libraries, but they might not be installed on the target system). I know about System.getProperty("user.name") but that returns the user ID not user NAME. ...

workaround for GWT+Jetty JSP compiler issue? (Java 1.5 source level not recognized)

As this thread shows, there seems to be an issue getting JSPs to compile in GWT hosted mode with the new Jetty server: 2. ERROR in /tmp/Jetty_0_0_0_0_8080_war____ut4fm1/jsp/org/apache/jsp/ test_jsp.java (at line 53) new java.util.ArrayList<String>(); ^^^^^^ Syntax error, parameterized types ar...

Simplest way to query XML in Java

I have small Strings with XML, like: String myxml = "<resp><status>good</status><msg>hi</msg></resp>"; which I want to query to get their content. What would be the simplest way to do this? ...

Do I want to minimize the scope of @Transactional?

Not sure if 'scope' is the correct term here. I am using Spring for JPA transaction management (with a Hibernate underneath). My method to preform database transaction is private, but since you can only set @Transactional on a class or on a public method Since this mechanism is based on proxies, only 'external' method calls coming i...