I need to communicate with another machine using the x.25 protocol and Java. Are there any Java Libraries available which will help me to accomplish my goal and is it even possible doing it with Java ?
...
I'm attempting to map an object model for "Promotions"; i.e., a customer enters a promo code during signup.
Different promo codes might have different types of "benefits", meaning what we are giving to the customer.
For example: promo code XYZ123 will give the customer free minutes in his or her account, while a different promo code w...
My client is a web browser, and sending request to myserver using this url:
http://localhost
This is the server side code. The problem lies in the run method of the ServingThread class.
class ServingThread implements Runnable{
private Socket socket ;
public ServingThread(Socket socket){
this.socket = socket ;
System....
I have a class A that has a set of B's. However, these two objects are linked by fields that are NOT the primary key.
For B, I can use , but how do I specify that the join should be in A.secondary_column, Not A. table_primary_key_id ?
<class table="a">
< id column="table_primary_key_id" >
< /id>
<property column="secondary...
I'm losing my mind on this one. My curl command works:
curl http://testuser:testpwd@qabox3:8501/xmlcontroller
But, when I try what looks like an equivalent http connection in Java it gives "connection refused". What am I missing? I've tried a dozen flavors of trying to make this connection today and am out of ideas.
URL url = ...
Hello,
I've been going through Sun Microsystem's Java Tutorial and got some questions while reading the following:
I/O from the Command Line: The Console Object
"Second, readPassword returns a character array, not a String, so the password can be
overwritten, removing it from memory as soon as it is no longer needed."
My questions ar...
I need to draw a line using java.awt.Graphis, but only the portion of the line that lies outside a rectangle should be rendered.
Is it possible to use the Graphics clipping support?
Or do I need to calculate the intersection and clip the line myself?
...
I'm really trying to like generics, but so far the trouble they've caused outweighs any benefits. Please, please show me I'm wrong.
I understand the necessity of adding @SuppressWarnings("unchecked") when using generic-free frameworks (Spring, Hibernate). This alone really reduces generics' value, as does requiring classes be passed i...
We just upgraded Tomcat and the newer Tomcat doesn't like nested quotes in the tag, so we have to alternate between single and double quotes. For example,
We used to have,
<form id="search" action="<fmt:message key="search.url"/>">
Now we can change it to,
<form id="search" action="<fmt:message key='search.url'/>">
What should I d...
Sorry for another vague example...but I have a single class where I'm starting a new thread instance. However, if I add a new thread instance, it interrupts (destroys?) the first.
But, if I run two instances of the class (separately, after I turn them into jar files) where each instance only opens up a single thread, they both run concu...
Ok so here is my issue. I have to HashSet's, I use the Removeall method to delete values that exist in one set from the other.
Prior to calling the method, I obviously add the values to the Sets. I call .toUpperCase() on each String before adding because the values are of different cases in both lists. There is no rhyme or reason to th...
I have an XML file as follows:
<rootNode>
<link>http://rootlink/</link>
<image>
<link>http://imagelink/</link>
<title>This is the title</title>
</image>
</rootNode>
The XML Java code using DOM is as follows:
NodeList rootNodeList = element.getElementsByTagName("link");
This will give me all o...
How do you serialize a subclass of Exception?
Here is my exception:
@XmlType
public static class ValidationFault extends Exception {
public ValidationFault() {
}
}
I have tried all sorts of variations on using @XmlTransient and @XmlAccessorType, but JAXB continually tries to serialize the getStackTrace/setStackTrace pair, which ...
i've been looking around, but i'm not sure how to do it.
i've found this page which, in the last paragraph, says:
A simple generator for random numbers taken from a Poisson distribution is obtained using this simple recipe: if x1, x2, ... is a sequence of random numbers with uniform distribution between zero and one, k is the first int...
I have an XML message like so:
<root>
<elementA>something</elementA>
<elementB>something else</elementB>
<elementC>yet another thing</elementC>
</root>
I want to compare a message of this type produced by a method under test to an expected message, but I don't care about elementA. So, I'd like the above message to be considered...
Hi all.
I'm developing a grid based sim game in java, and I was wondering if there is a standard way of doing the following.
I have a panel which is the game panel, and there are many different things which could happen when the panel is clicked. For example, when building a room, there are several stages, where dragging the mouse and l...
I'm doing some graphics processing and HTML is a perfect choice for styling the displayed content. I'm trying to reuse swing's built in html support, and it works perfectly if I hard code the height passed to View.paint, but I can't figure out how to determine how tall the bounds of the rendered content would be at runtime given a specif...
Hello,
There is a "NameAndType" structure in the constants pool in .class file.
It is used for dynamic binding.
All methods that class can "export" described as "signature + return type".
Like
"getVector()Ljava/util/Vector;"
That breakes my code when return type of the method in some .jar is changed, even if new type is narrower.
...
I'm on Windows Vista 64 bit, with a 64 bit jvm installed. I'm trying to use jstack and jmap -- two utilities that come with the JDK -- to peek into an application server's guts. This works fine on a windows xp machine, 32 bit.
However, when I run these commands against the processid for a ColdFusion application server on this vista64 ma...
Hello,
I recently pickup Java so I have very limited knowledge, but I would like to know if it's possible to get DLL version using Java. If it is not possible, is it possible to use C# to get Jar version through the manifest file?
...