Java software developer, game developer, gamer.

Jul
2
awarded Necromancer
Jun
30
comment Removing all properties from a object
He thinks it should print an empty object because that's what the question is asking. Once you remove all properties from an object, you have an empty object.
Jun
29
revised how to create something to receive the data from a page in a tomcat server?
deleted 4 characters in body
Jun
29
comment how to create something to receive the data from a page in a tomcat server?
No problem. I think if you take a look at this link (openscope.net/2010/01/25/war-deployment-file-structure) it should help with putting together a war. There are a few automated ways to do it too (maven archetypes, I think Eclipse can also).
Jun
29
revised how to create something to receive the data from a page in a tomcat server?
added 873 characters in body
Jun
29
answered how to create something to receive the data from a page in a tomcat server?
Jun
29
awarded Autobiographer
Jun
29
comment Can an Object type be casted to a Component type?
If any of the answers here have helped you, you should look into accepting them: meta.stackexchange.com/questions/5234/…
Jun
26
comment Can an Object type be casted to a Component type?
Read up on "Polymorphism", it will help you understand what's going on here
Jun
26
comment Can an Object type be casted to a Component type?
In the case you gave, it's returning a String. It's interface says it will return an Object or anything that inherits from it, depending on the list you're calling it on
Jun
26
comment Can an Object type be casted to a Component type?
So that means the .getSelectedValue() you called didn't return a Component but a String instead.
Jun
26
comment Can an Object type be casted to a Component type?
Then you should be able to pass it into JPanel.add() like so JPanel.add((Component) test_jList);
Jun
26
answered Can an Object type be casted to a Component type?
Jun
26
comment Why is declaring List implementation not needed?
The point of using the interfaces is that you shouldn't care where it's implemented, just that it's a List. The ArrayList type is an implementation of it, and is probably the most common. So you could use List<Integer> list = new ArrayList<Integer>();. You can find default implementations of List interface in oracle docs (docs.oracle.com/javase/6/docs/api/java/util/List.html) and see "All known implementing classes"
Jun
26
comment How can I detect if Raspberry Pi is plugged in a windows PC
I'd look into doing a network discovery and checking if any MAC addresses returned match the Pi's Vendor Id (See this standards-oui.ieee.org/oui.txt for OUI references). It shows raspberry pi as: B827EB.
Jun
26
comment Why is declaring List implementation not needed?
You should look up interfaces/abstract classes and see how they're used in Java. It's an important set of knowledge to have, especially when dealing with high profile libraries like Android and the JDK, since Interfaces are used almost everywhere in them.
Jun
26
comment How can I detect if Raspberry Pi is plugged in a windows PC
Do you mean plugged in via USB? Or something else?
Jun
25
comment Purpose of using permitAll() in PreAuthorize annotation in Spring Security
I went through the code, and besides just being explicit about permissions (which is a good reason) I can't find a concrete, functional reason behind it. If you passed an actual Authentication into the method, then the PermissionEvaluator implemented can investigate the provided Authentication to determine whether it's authorized to access the method.
Jun
25
comment Purpose of using permitAll() in PreAuthorize annotation in Spring Security
Without being able to see your entire spring configuration it will be near impossible to give you concrete reasoning for it being there. The usage of null means that the implementation of PermissionEvaluator being used for your hasPermission() calls doesn't care about any Authentication objects (maybe it's pulling it from session each time instead). Unfortunately it's really hard to give you explicit reasoning without seeing more than just this method signature.
Jun
25
comment Purpose of using permitAll() in PreAuthorize annotation in Spring Security
I'm not sure why your code had it there to begin with, but it may actually be different than no annotation. Spring cascades the @PreAuthorize annotations because they're applicable to classes too. If a @PreAuthorize annotation is on the class, and then nothing is on the method, the method inherits the classes @PreAuthorize. He could have also done it with the intent of being explicit ("Any user can use potentially access this, don't return any sensitive information")
1 2 3 4 5