java1.4

Recommendations for a Java 1.4 MVC framework for Jrun? [closed]

六眼飞鱼酱① 提交于 2019-12-11 18:46:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am revisiting a project and need to limit it to Java 1.4 (unfortunately). I was interested in introducing a MVC framework to improve ease of maintenance in the future. Besides Struts 1, what options do I have? The lightweight the framework, the better. Not to dismiss Struts off hand, I've just heard a lot of

how to play wav file in java 1.4

牧云@^-^@ 提交于 2019-12-11 09:14:34
问题 as title How can i play a sound file repeatedly in java v1.4? 回答1: If you just want to play the wav file then 'org.life.java''s answer is correct. For other format types you can use JMF( http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html ). Note: JMF is obsolete now... But it will work with jdk 1.4 回答2: import java.net.URL; import javax.sound.sampled.*; public class LoopSound { public static void main(String[] args) throws Exception { URL url = new URL( "http://pscode

To use AES with 256 bits in inbuild java 1.4 api

╄→尐↘猪︶ㄣ 提交于 2019-12-06 16:00:09
问题 I am able to encrypt with AES 128 but with more key length it fails. code using AES 128 is as below. import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.io.*; /** * This program generates a AES key, retrieves its raw bytes, and * then reinstantiates a AES key from the key bytes. * The reinstantiated key is used to initialize a AES cipher for * encryption and decryption. */ public class AES { /** * Turns array of bytes into string * * @param buf Array of

Getting No such algorithm exception while using TLSV1.2 in java 1.4

杀马特。学长 韩版系。学妹 提交于 2019-12-06 13:49:23
问题 I am trying to hit a webservice which supports TLSv1.2. I am using Java 1.4. It does not support TLSv1.2. Now someone told me that BC could solve my problem. Though does it work with a SSLEngine as drop in replacement somehow? Is this possible with BC? What do I have to do to get a working SSLEngine (for use with TLSv1 in a nonblocking io scenario) without such low restrictions on primesize for DH. What I tried: Security.addProvider(new BouncyCastleProvider()); This alone seems not to solve

Getting No such algorithm exception while using TLSV1.2 in java 1.4

…衆ロ難τιáo~ 提交于 2019-12-04 18:20:30
I am trying to hit a webservice which supports TLSv1.2. I am using Java 1.4. It does not support TLSv1.2. Now someone told me that BC could solve my problem. Though does it work with a SSLEngine as drop in replacement somehow? Is this possible with BC? What do I have to do to get a working SSLEngine (for use with TLSv1 in a nonblocking io scenario) without such low restrictions on primesize for DH. What I tried: Security.addProvider(new BouncyCastleProvider()); This alone seems not to solve the problem. So instead of SSLContext.getInstance("TLSv1"); //which works alas only little DH keys. I

alternatives for volatile array

折月煮酒 提交于 2019-12-04 14:39:28
From other questions, I learned that the elements of a volatile array are not volatile. Only the reference itself is volatile. volatile[] int data; Thread A: data[4] = 457; Thread B: System.out.println(data[4]); Here, Thread B might never see the updated value. Which options/alternatives do I have to achieve the same thing? I would like to avoid having to synchronize the array, since it is hardly ever altered. However, it is being read a lot by some threads. Synchronizing it will very likely lower the throughput, which is very important in this example. Is my only option a copy-on-write data

Conditional Number Formatting In Java

房东的猫 提交于 2019-12-01 18:18:13
问题 How can I format Floats in Java so that the float component is displayed only if it's not zero? For example: 123.45 -> 123.45 99.0 -> 99 23.2 -> 23.2 45.0 -> 45 Edit: I forgot to mention - I'm still on Java 1.4 - sorry! 回答1: If you use DecimalFormat and specify # in the pattern it only displays the value if it is not zero. See my question How do I format a number in java? Sample Code DecimalFormat format = new DecimalFormat("###.##"); double[] doubles = {123.45, 99.0, 23.2, 45.0}; for(int i=0

Conditional Number Formatting In Java

末鹿安然 提交于 2019-12-01 18:04:34
How can I format Floats in Java so that the float component is displayed only if it's not zero? For example: 123.45 -> 123.45 99.0 -> 99 23.2 -> 23.2 45.0 -> 45 Edit: I forgot to mention - I'm still on Java 1.4 - sorry! ScArcher2 If you use DecimalFormat and specify # in the pattern it only displays the value if it is not zero. See my question How do I format a number in java? Sample Code DecimalFormat format = new DecimalFormat("###.##"); double[] doubles = {123.45, 99.0, 23.2, 45.0}; for(int i=0;i<doubles.length;i++){ System.out.println(format.format(doubles[i])); } Check out the

Web service frameworks for Java 1.4?

荒凉一梦 提交于 2019-11-30 23:16:52
We want to implement web services on our Weblogic 8.1 Java 1.4 application. We want to create new server services and call services in other apps. And we need to stick with Java 1.4 (for now). Due to 1.4 we can't use frameworks like Restlet or Jersey. Are there any good web service (preferably REST) API frameworks that support Java 1.4? We could do a home grown solution if necessarily. Ie: just setup servlets on the server side and on the client side just use something like HttpURLConnection . Java 1.4 is EOL since 2006. REST become a 'hype' since around 2008. Almost no one API/framework

Web service frameworks for Java 1.4?

眉间皱痕 提交于 2019-11-30 18:32:13
问题 We want to implement web services on our Weblogic 8.1 Java 1.4 application. We want to create new server services and call services in other apps. And we need to stick with Java 1.4 (for now). Due to 1.4 we can't use frameworks like Restlet or Jersey. Are there any good web service (preferably REST) API frameworks that support Java 1.4? We could do a home grown solution if necessarily. Ie: just setup servlets on the server side and on the client side just use something like HttpURLConnection.