java

Is Finding the Symmetric-Key possible when is Message short and known to an attacker?

Hello, I need to encrypt several parameters in a request (with Java, AES(cbc), 128 BIT Key): String toencrypt = "name+birthdate+appid+userid" I have to assume that an attacker can guess all the values. What does this have for an impact on guessing/finding the symmetric key? Are symmetric Keys nevertheless secure even if the content t...

Is Java bytecode compatible within different updates of the same version of Java?

Hello, this question is related to the the other topic discussed here: http://stackoverflow.com/questions/1266940/is-java-bytecode-compatible-with-different-versions-of-java but in this case would like to know whether compatibility is preserved within the same version but on different updates. For example, is bytecode generate by the com...

Java Swing Updating before processing

Hi I have a little app that at the moment consists of a JPanel with an "Open File" button. Once the user clicks the button a new JFileChooser is created so the user can select a file. Once the user selected a file, this file will be processed. What I want to do, is to set the text on the JPanel to "Processing File" While the file is be...

Java tree node details

I have built a tree using JTree and I want to obtain the node details(like they appear in the frame drawn here). ...

Why IllegalArgumentException (JDK 1.4.2) cannot be constructed with a throwable cause ?

From a class extending java.beans.PropertyEditorSupport : /** * Sets the property value by parsing a given String. May raise * java.lang.IllegalArgumentException if either the String is * badly formatted or if this kind of property can't be expressed * as text. * * @param text The string to be parsed. */ public void setAsText(...

Check String for Alphabetical Characters

If I have the strings "hello8459" and "1234", how would I go about detecting which one had the alphabetical characters in? I've been trying: //Checking for numerics in an if... Pattern.matches("0-9", string1); However it doesn't work at all. Can anyone advise? ...

Java: PropertyResourceBundle

public static String fnGetProperty(String ABC) { PropertyResourceBundle configBundle = (PropertyResourceBundle)ResourceBundle.getBundle("ManUtd"); return configBundle.getString(ABC); } Please help me to explain the above codes...Thanks ^^ ...

Android - Writing a custom (compound) component

The Android app I'm currently developing has a main activity that has grown quite large. This is mainly because it contains a TabWidget with 3 tabs. Each tab has quite a few components. The activity has to control of all those components at once. So I think you can imagine that this Activity has like 20 fields (a field for almost every c...

Several instances of Netbeans on Win 32 platform

It it possible to have several instances of Netbeans running as you can with Visual Studio on Win 32 platform? I can just fire up one. ...

Postfix email stream parsing

Hello, I am using Postfix smtp server for receiving mails. My requirement is to take the mail objects from Postfix and parse the mail objects so that the individual mail objects can be used in my java code as soon as a mail is received by Postfix. One of the solutions that i have come up is to have a content filter communicating wit...

Why can't a Generic type containing a Generic type be assigned to a Generic typed class of wildcard type

Sorry if the title seems confusing, but some examples are in order. Let's say I have some Java class with a generic type parameter: public class GenericClass<T> { } I can create a variable typed to store an object, with the generic parameter set to, say a String. Java will also let me assign that variable to another variable but with...

How do I refresh jsp's on weblogic

I'm running an exploded war on weblogic 10.0 in production mode. I want to modify a jsp without having to fully redeploy the application. I can't seem to achieve this using the weblogic.Deployer with a partial redployment - see: http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs100/deployment/redeploy.html#wp1025739 This must ...

How to disable default textfield shortcuts in JTextField

I have a custom textfield class that extends the JTextField class in Swing. I need to find a way to disable the default actions for Ctrl-A (select all), Ctrl-H (backspace) etc, so that the window containing the textfield can map these shortcuts to whatever it wants. Any help would be greatly appreciated. ...

(N)Hibernate find content from schema: Object <- AttributeValue -> Attribute

We have a common db schema of: Object <- AttributeValue -> Attribute lets say we talk about houses. The house can have lots and lots of attributes (door shape, roof color etc.). The number of attributes for concrete house is not known. Straight forward mapping to objects is used: House - contains collection of HouseAttributeValue ...

How can I allow concurrent reads but block all access during a write on an object in Java?

If I have a data structure in a multithreaded application that I want to access simultaneously with reads while it's not altered, but disallow both read and write access to other threads while one is writing? For simplicity, let's say I have an array and two methods read() and write(): int[] rgData; // ... int read(int ix) { retu...

Attributes on Many-to-Many relationships (Hibernate)

Hi guys, I have entity classes A and C. They are mapping the tables tblA and tblC and have a many-to-many relationship between them, with tblB to map between them. tblB contains A_ID, C_ID and SetDate, the last one being the date it was set, thus an attribute to the relationship. My question is, how do I best map in this attribute? At t...

java.util.MissingResourceException when running a jar

Hi All, In order to internationalise my code, I use a property file called MessagesBundle_en_UK.properties which is located in a resource folder called config so that I the following structure: +---src \---com \---proj \---messages Messages.java +---config \-...

Use object's method in a jstl page

Hi All, I have a model with this method: public List<String> getPriviledgeNames() I'm trying to display a list of checkbox in my jstl page, and I'd like to checked only the ones which their name is in the list returned from my model. So I have something like: <li> <input type="checkbox" name ="priviledge" id="CheckBox2" class="c...

JSR305 vs. JSR308 (Java Type Anotations) - Which is going to be the standard?

Hello! There seem to be two different JSRs for annotations. JSR-305: Annotations for Software Defect Detection (additional resource) JSR-308: Annotations on Java Types (additional resource) Both seem to be oriented towards static code analysis. Do you know: which of the both is going to be either in Java SE 7 or Java EE 6? how "s...

How to connect to a Weblogic JMS queue using t3s?

I want the last of these lines in a standalone application to pass with no exceptions thrown: Properties props = new Properties(); props.setProperty("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory"); props.setProperty("java.naming.provider.url", "t3s://localho...