JDk1.5 Vs JDK1.4
Whether below given statement would compile in JDK 1.5.
Right now it is fine in Jdk 1.4 pls tell us such we can shift from JDK1.4 to JDK 1.5
Enumeration enum = aRequest.getParameterNames();
Whether below given statement would compile in JDK
1.5.
Right now it is fine in Jdk 1.4 pls tell us such we
can shift from JDK1.4 to JDK 1.5
Enumeration enum = aRequest.getParameterNames();Rename enum.
Kaj
Similar Messages
-
Difference between JDB of jdk1.3 & jdk1.4 (hot swap)
Hello all,
I have compiled & enahnced ny classes using jdk1.3.
By enhancing the classes I mean I am modifying the classfile at bytecode level & not at source code level. For enhancing the classes we load the original classes once & then change the bytecodes.
When I try to debug the the classes after enhancement using JDB of jdk1.3 I am getting error like,
"Unable to set breakpoint Person:11 : No linenumber information for Person. Try compiling with debugging on."
But when debugged the class using JDB of jdk1.4 its working fine.
Did anybody come around this situation anytime?
Do anybody know , is there any difference in JDB of jdk1.3 & jdk1.4?
According to jdk1.4 datasheet, JDB 1.4 provides one feature
called "hotswap". Does this feature helping us to debug the classes even after enhancement? If yes then how it is doing?Hello all,
I have compiled & enahnced ny classes using jdk1.3.
By enhancing the classes I mean I am modifying the
e classfile at bytecode level & not at source code
level. For enhancing the classes we load the original
classes once & then change the bytecodes.What kind of changes are you making when you "enhance"?
Do you write the modified .class files out again, and
then run them? Is the debug information in the new .class
file (line number table, local variable information, etc)
still accurate and consistent after your modification?
Do the enhanced classes run OK when you turn on verification?
EG: without debugging, can you run them with -Xfuture
added to the command line?
Can you use javap -l -verbose <class id> to inspect
the modified class?
When I try to debug the the classes after
r enhancement using JDB of jdk1.3 I am getting error
like,
"Unable to set breakpoint Person:11 : No linenumber
information for Person. Try compiling with debugging
on."
But when debugged the class using JDB of jdk1.4 its
working fine.
Did anybody come around this situation anytime?
Do anybody know , is there any difference in JDB of
jdk1.3 & jdk1.4?
According to jdk1.4 datasheet, JDB 1.4 provides one
feature
called "hotswap". Does this feature helping us to
debug the classes even after enhancement? If yes then
how it is doing?"hotswap" allows you to redefine the bytecodes of a class. Not all
JVM implementations support this feature. Refer to this page for more
information:
http://java.sun.com/j2se/1.4.1/docs/guide/jpda/jdi/com/sun/jdi/VirtualMachine.html#redefineClasses(java.util.Map)
redefineClass is implemented in the jdb reference debugger
via the redefine <class id> <class file name> command. -
1. My test is ON solaris 10
bash-3.00# cat /etc/release
Solaris 10 5/08 s10s_u5wos_10 SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 24 March 2008
T-3000 Recovery Version: T3.04.01.01 Tue Nov 25 08:25:07 CST 2008
bash-3.00#
bash-3.00# showrev
Hostname: T2000G2
Hostid: 84cb7384
Release: 5.10
Kernel architecture: sun4v
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain: emsdomain
Kernel version: SunOS 5.10 Generic_137111-052. My test code:
public class Test {
public static void main(String[] args){
long start = System.currentTimeMillis();
int n=0;
for (long i=0;i<100000000;i++){
n ++;
System.out.println("time: "+(System.currentTimeMillis()-start)/1000.0);
}3.Test result
a) Default JDK is JDK1.6_12.
It print:
bash-3.00# java Test
time: 2.834b) Latest JDK1.6_19:
It print:
bash-3.00# java Test
time: 2.912c) JDK1.5_22
It print:
bash-3.00# java Test
time: 1.0394.Summary:
JDK1.6_12/JDK1.6_19 is almost *3 times slower than* JDK1.5_22.
After J2SE_Solaris_10_Recommended.zip is installed(ONLY part of them is installed successfully),
the result is the same!!!
Does this because the solaris 10 OS is not patched with the latest patch[10_Recommended.zip]?
Edited by: xiangyingbing on Apr 8, 2010 8:31 PMI am wondering why the default JDK1.6_12 on solaris is sooooooooooooooooo slow!!!
I am wondering why the default JDK1.6_12 on solaris is sooooooooooooooooo slow!!!
I am wondering why the default JDK1.6_12 on solaris is sooooooooooooooooo slow!!! -
Is this a bug in Swing in JDK1.6/JDK1.7 but not in JDK1.5?
I have an application for which GUI was developed in Java Swing JDK1.5.I am planning to upgrade the JDK to JDK1.6 but doing so produces problem for me.
Problem Statement : If I open few dialogs(say 10) and dispose them and than call method 'getOwnedWindows()' , it returns 0 in JDK1.5 but returns 10 in JDK1.6. As in JDK1.6 it returns 10, my algorithm to set focus is not working correctly as it is able to find invlaid/disposed dialogs and try to set the focus on it but not on the correct and valid dialog or component because algorithm uses getOwnedWindows() to get the valid and currently open dialog.
Can anyone suggest me the workaround to avoid this problem in JDK1.6?
Following piece of code can demonstrate the problem.
Custom Dialog Class :
import javax.swing.JDialog;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionEvent;
public class CustomDialog extends JDialog implements ActionListener {
private JPanel myPanel = null;
private JButton yesButton = null;
private JButton noButton = null;
private boolean answer = false;
public boolean getAnswer() { return answer; }
public CustomDialog(JFrame frame, boolean modal, String myMessage) {
super(frame, modal);
myPanel = new JPanel();
getContentPane().add(myPanel);
myPanel.add(new JLabel(myMessage));
yesButton = new JButton("Yes");
yesButton.addActionListener(this);
myPanel.add(yesButton);
noButton = new JButton("No");
noButton.addActionListener(this);
myPanel.add(noButton);
pack();
setLocationRelativeTo(frame);
setVisible(true);
//System.out.println("Constrtuctor ends");
public void actionPerformed(ActionEvent e) {
if(yesButton == e.getSource()) {
System.err.println("User chose yes.");
answer = true;
//setVisible(false);
else if(noButton == e.getSource()) {
System.err.println("User chose no.");
answer = false;
//setVisible(false);
public void customFinalize() {
try {
finalize();
} catch (Throwable e) {
e.printStackTrace();
}Main Class:
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.ActionEvent;
import java.awt.FlowLayout;
import java.awt.Window;
public class TestTheDialog implements ActionListener {
JFrame mainFrame = null;
JButton myButton = null;
JButton myButton_2 = null;
public TestTheDialog() {
mainFrame = new JFrame("TestTheDialog Tester");
mainFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
myButton = new JButton("Test the dialog!");
myButton_2 = new JButton("Print no. of owned Windows");
myButton.addActionListener(this);
myButton_2.addActionListener(this);
mainFrame.setLocationRelativeTo(null);
FlowLayout flayout = new FlowLayout();
mainFrame.setLayout(flayout);
mainFrame.getContentPane().add(myButton);
mainFrame.getContentPane().add(myButton_2);
mainFrame.pack();
mainFrame.setVisible(true);
public void actionPerformed(ActionEvent e) {
if(myButton == e.getSource()) {
System.out.println("getOwnedWindows 1 " + mainFrame.getOwnedWindows().length);
createMultipleDialogs();
int i = 0;
for (Window singleWindow : mainFrame.getOwnedWindows()) {
System.out.println("getOwnedWindows " + i++ + " "
+ singleWindow.isShowing() + " "
+ singleWindow.isVisible() + " " + singleWindow);
System.out.println("getOwnedWindows 2 " + mainFrame.getOwnedWindows().length);
//System.gc();
System.out.println("getOwnedWindows 3 " + mainFrame.getOwnedWindows().length);
//System.gc();
System.out.println("getOwnedWindows 4 " + mainFrame.getOwnedWindows().length);
} else if (myButton_2 == e.getSource()) {
System.out.println("getOwnedWindows now: " + mainFrame.getOwnedWindows().length);
public void createMultipleDialogs() {
for (int a = 0; a < 10; a++) {
CustomDialog myDialog = new CustomDialog(mainFrame, false,
"Do you like Java?");
myDialog.dispose();
myDialog.customFinalize();
public static void main(String argv[]) {
TestTheDialog tester = new TestTheDialog();
}Running the above code gives different output for JDK1.5 and JDK1.6
I would appreciate your help in this regards.
ThanksFix your algorithm to check if the windows are displayable/showing instead of assuming they are?
-
Diff Between Jdk1.3 & Jdk1.4(abt stack trace)
Jdk 1.4 gives a facility that we can aceess stack trace across jvms but we cant' do it through 1.3. If we want to achieve through jdk1.3 then how can we do it.
See printStackTrace(PrintStream s) and printStackTrace(PrintWriter s)
Kaj -
Changing from JDK 1.2 to JDK1.3
Hello,
I have JDK1.2, JDK1.3 and JDK 1.4 in my system. By default the version is taken as JDK 1.2.
I need to change this to 1.3. I have tried changing the registry settings which didn't work.
Any suggestions on this would be appriciated
Regards
V123Maybe my question did not have the correct approach.
I need to develop a web service client which must run on java virtual machine 1.2
I ve tried with axis, glue and jax-rpc but all they need the java.lang.reflect.InvocationHandler interface available since jdk1.3
So the question is: What can I use to write that client without that interface? -
No ocijdbc8 Error (RH71,ORA816,JDK1.3)
I meet same ploblem when change any element
for connect remote db:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.l
ibrary.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)
at java.lang.Runtime.loadLibrary0(Runtime.java:749)
at java.lang.System.loadLibrary(System.java:820)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:209)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at JdbcCheckup.main(JdbcCheckup.java:42)
the program is $ORACLE_HOME/jdbc/demo/samples/oci8/bisic_samplem/JdbcCheckup.java
OS: RH7.1(japanese)
JDK : JDK1.3(JDK1.2.2 dont work on RH71)
ORACLE: oracle EE816 for Linux
(libocijdbc8.so is in the $ORACLE_HOME/lib)
JDBC: classes12.zip for solaris(oracle816)
please help me,thank you.
xu
nullXu Fang,
OCI8 (JDBC 1.2 'thick' driver) is not supported on Linux (8.1.5,8.1.6 or 8.1.7). You can use the thin driver, but not the OCI8 driver.
Regards,
Josue Amaro
Linux Product Manager
Oracle Corporation
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Xu FANG ([email protected]):
I meet same ploblem when change any element
for connect remote db:<HR></BLOCKQUOTE>
null -
Pls help me, where can i find the place to download JDK1.2 ?
pls help me, where can i find the place to download JDK1.2 ?
i think the download site has been moved to elsewhere...
i have searched for the site but it is coming as japanese site.
kindly guide me to locate the download pageGo to the URL:
http://java.sun.com/products
There you shall find a drop-down combobox listing all the products. Select the JDK1.2/JDK1.3 and proceed.
Ironluca :D -
JDK1.4 Vs JDK1.3
Hello Gurus,
Is there any doc saying what are all the differences between JDK1.4 &
JDK1.3 ?
Thanks In Advance,
Olabora.If you are talking about new feature of JDK 1.4, check out:
http://java.sun.com/j2se/1.4/docs/relnotes/features.html
These are different from JDK 1.3.x -
Note works under JDL 1.3.1, but not under JDK 1.2.2. Is there a fix?
C:\bea\wlserver6.1\samples>c:\jdk1.3.1_01\bin\java
examples.jndi.InitialContextExample t3://localhost:9001 system password
WebLogic context created on behalf of "system"
C:\bea\wlserver6.1\samples>java examples.jndi.InitialContextExample
t3://localhost:9001 system password
java.io.StreamCorruptedException: Type code out of range, is 0
at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1280)
at
java.io.ObjectInputStream.SkipToEndOfBlockData(ObjectInputStream.java
:1211)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
:776)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:107)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:115)
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:6
86)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(Connecti
onManagerClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compi
led Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested
except
ion:
[java.io.StreamCorruptedException: Type code out of range, is 0]
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:6
88)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(Connecti
onManagerClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compi
led Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
Failed to contact t3://localhost:9001.
Is there a server running at this address?
C:\bea\wlserver6.1\samples>Right. Using WebLogic RMI proprietary implementation (t3) with 6.1 requires
1.3 on the client side. If you absolutely have to use 1.2 on the client side,
IIOP should work - I just tried this and it looks like WebLogic 6.1 implements
EJB spec interop requirements pretty well.
Jonathon Cano <[email protected]> wrote:
I saw an article saying use iiop and then deploy your beans for such. I can
get context over IIOP using jdk1.2.2 to WLS 6.1. I have not yet deployed
beans or recompiled anything to try this all the way. Does this work?
Should I proceed? or is there a gotcha?
"Dimitri Rakitine" <[email protected]> wrote in message
news:[email protected]...
6.1 requires 1.3 on the client. (it uses dynamic proxies, so 1.2 willnot
work).
Jonathon Cano <[email protected]> wrote:
Note works under JDL 1.3.1, but not under JDK 1.2.2. Is there a fix?
C:\bea\wlserver6.1\samples>c:\jdk1.3.1_01\bin\java
examples.jndi.InitialContextExample t3://localhost:9001 system password
WebLogic context created on behalf of "system"
C:\bea\wlserver6.1\samples>java examples.jndi.InitialContextExample
t3://localhost:9001 system password
java.io.StreamCorruptedException: Type code out of range, is 0
at
java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1280)
at
java.io.ObjectInputStream.SkipToEndOfBlockData(ObjectInputStream.java
:1211)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
:776)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
atjava.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:107)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:115)
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:6
86)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(Connecti
onManagerClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
atweblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compi
led Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
Code)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - withnested
except
ion:
[java.io.StreamCorruptedException: Type code out of range, is 0]
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:6
88)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(Connecti
onManagerClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
atweblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compi
led Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
Code)
Failed to contact t3://localhost:9001.
Is there a server running at this address?
C:\bea\wlserver6.1\samples>--
Dimitri
Dimitri -
JDBC/OCI driver for JDK1.2
Hi,
I have an evaluation copy of Oracle8 version 8.0.3.0 and
downloaded the JDBC/OCI driver for JDK1.1 (classe111.zip). The
example I used was also taken from this site, which connects to
the database and lists ename from emp, using scott/tiger.
Everything worked fine under JDK1.1 but I can't get the code to
work with JDK 1.2
Does Oracle provide a JDBC/OCI driver that will work with JAVA
1.2 or am I missing something. Please note that I am not using
Oracle8i.
Any assistance would be greatly appreciated.
Karim
nullKarim,
Openlink Software (http://www.openlinksw.com) provides JDBC 2.0
drivers in version 3.2. This version will be hitting our public
web site next week, but you can get pre-release components from
ftp://ftp.openlinksw.com/pre-3.2/index.html
The JDK 1.2 drivers are all the way at the bottom under the
Windows section.
HTH,
Stephen
Karim (guest) wrote:
: Hi,
: I have an evaluation copy of Oracle8 version 8.0.3.0 and
: downloaded the JDBC/OCI driver for JDK1.1 (classe111.zip). The
: example I used was also taken from this site, which connects
to
: the database and lists ename from emp, using scott/tiger.
: Everything worked fine under JDK1.1 but I can't get the code
to
: work with JDK 1.2
: Does Oracle provide a JDBC/OCI driver that will work with JAVA
: 1.2 or am I missing something. Please note that I am not using
: Oracle8i.
: Any assistance would be greatly appreciated.
: Karim
null -
Oracle Lite + Resin + jdk1.2.2 or jdk 1.3.1 problem
Hi!
Can some one help me this the following:
I used Oracle Lite database, Resin app server and jdk1.2.2
When I try to connect my database through simple java-application, all goes fine! But, when I trying to get database communication from my application server and problem arise. First of all dll's such as
OLJDBC40.DLL, OLAD2040.DLL, OLOBJ40.DLL, OLOD2040.DLL OLSQL40.DLL are in the Path and JVM loads them at runtime. I got connection to DB. Than I try to get some DatabaseMetaData info and got EXCEPTION_ACCESS_VIOLATION (for jdk1.3) and "java.exe has generated error (for jdk1.2.2)" errors from VM.
So, any idea?
Any help apriciated...
RGS,
parasolkoHi,
I have got the similar problem when I used MS SQL server + Tomcat + JDK1.3.0 via JdbcOdbc driver. In that configuration the JVM crashs very often. It seems that JdbcOdbc's got unstable problem. Then, I tried other type 4 JDBC driver, it works fine and JVM won't crash. Try Sprinta 2000 JDBC driver, it's a type 4 driver and fast stable.
Ma -
Why dynamic table creation with struts working only for JDK1.3.1_02 version
Row
import java.util.Vector;
public class Row
private static int colsize;
private Column[] columns;
public void setColumns(Column[] columns)
System.out.println("SetColumns");
this.columns = columns;
public void setColumn(int i, Column column)
System.out.println("setting"+ i+"th column"+column);
public Column[] getColumns()
return null;
public Column getColumns(int i)
System.out.println("Column"+i);
System.out.println("Colsize"+colsize);
if(columns == null)
columns= new Column[colsize];
if(columns[i] == null)
columns[i] = new Column();
return columns;
public int getColsize()
return colsize;
public static void setColsize(int size)
colsize = size;
Column:
public class Column
private String value;
public void setValue(String value)
System.out.println("Value="+value);
this.value = value;
public String getValue()
return value;
ApplicationResources:
button.cancel=Cancel
button.confirm=Confirm
button.reset=Reset
button.save=Save
database.load=Cannot load database from {0}
error.database.missing=<li>User database is missing, cannot validate logon credentials</li>
error.fromAddress.format=<li>Invalid format for From Address</li>
error.fromAddress.required=<li>From Address is required</li>
error.fullName.required=<li>Full Name is required</li>
error.host.required=<li>Mail Server is required</li>
error.noSubscription=<li>No Subscription bean in user session</li>
error.password.required=<li>Password is required</li>
error.password2.required=<li>Confirmation password is required</li>
error.password.match=<li>Password and confirmation password must match</li>
error.password.mismatch=<li>Invalid username and/or password, please try again</li>
error.replyToAddress.format=<li>Invalid format for Reply To Address</li>
error.transaction.token=<li>Cannot submit this form out of order</li>
error.type.invalid=<li>Server Type must be 'imap' or 'pop3'</li>
error.type.required=<li>Server Type is required</li>
error.username.required=<li>Username is required</li>
error.username.unique=<li>That username is already in use - please select another</li>
errors.footer=</ul><hr>
errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
errors.ioException=I/O exception rendering error messages: {0}
heading.autoConnect=Auto
heading.subscriptions=Current Subscriptions
heading.host=Host Name
heading.user=User Name
heading.type=Server Type
heading.action=Action
index.heading=MailReader Demonstration Application Options
index.logon=Log on to the MailReader Demonstration Application
index.registration=Register with the MailReader Demonstration Application
index.title=MailReader Demonstration Application (Struts 1.0-b1)
index.tour=A Walking Tour of the Example Application
linkSubscription.io=I/O Error: {0}
linkSubscription.noSubscription=No subscription under attribute {0}
linkUser.io=I/O Error: {0}
linkUser.noUser=No user under attribute {0}
logon.title=MailReader Demonstration Application - Logon
mainMenu.heading=Main Menu Options for
mainMenu.logoff=Log off MailReader Demonstration Application
mainMenu.registration=Edit your user registration profile
mainMenu.title=MailReader Demonstration Application - Main Menu
option.imap=IMAP Protocol
option.pop3=POP3 Protocol
prompt.autoConnect=Auto Connect:
prompt.fromAddress=From Address:
prompt.fullName=Full Name:
prompt.mailHostname=Mail Server:
prompt.mailPassword=Mail Password:
prompt.mailServerType=Server Type:
prompt.mailUsername=Mail Username:
prompt.password=Password:
prompt.password2=(Repeat) Password:
prompt.replyToAddress=Reply To Address:
prompt.username=Username:
registration.addSubscription=Add
registration.deleteSubscription=Delete
registration.editSubscription=Edit
registration.title.create=Register for the MailReader Demostration Application
registration.title.edit=Edit Registration for the MailReader Demonstration Application
subscription.title.create=Create New Mail Subscription
subscription.title.delete=Delete Existing Mail Subscription
subscription.title.edit=Edit Existing Mail Subscription
LogonForm
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class LogonForm extends ActionForm
private String username;
private String password;
private String errors;
public String getUsername()
return username;
public void setUsername(String username)
this.username = username;
public void setPassword(String password)
this.password = password;
public String getPassword()
return password;
public String getErrors()
return errors;
public void setErrors(String errors)
this.errors = errors;
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((username == null) || (username.length() < 1))
errors.add("username", new ActionError("error.username.required"));
if ((password == null) || (password.length() < 1))
errors.add("password", new ActionError("error.password.required"));
return errors;
TableForm
import org.apache.struts.action.ActionForm;
import java.util.Vector;
public class TableForm extends ActionForm
private static int rowsize;
private Row[] rows;
public Row getRows(int i)
System.out.println("Row"+i);
System.out.println("Rowsize"+rowsize);
if(rows == null)
rows = new Row[rowsize];
if(rows[i] == null)
rows[i] = new Row();
return rows[i];
public Row[] getRows()
return null;
public void setRows(Row[] rows)
System.out.println("SetRows");
// this.rows=rows;
public static void setRowsize(int size)
rowsize = size;
public int getRowSize()
return rowsize;
LogonAction
import java.io.IOException;
import java.util.Hashtable;
import java.util.Locale;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;
public class LogonAction extends Action
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
LogonForm logonForm = (LogonForm) form;
System.out.println(logonForm);
System.out.println(logonForm.getUsername());
System.out.println(logonForm.getPassword());
if(logonForm.getUsername().equals("test") && logonForm.getPassword().equals("test"))
//TableForm tform = new TableForm();
//tform.setRowsize(2);
//tform.getRows(0).setColsize(2);
//tform.getRows(1).setColsize(2);
//request.getSession().setAttribute("tableForm",tform);
System.out.println("Table Form setRowSize");
TableForm.setRowsize(2);
System.out.println("Table Form set ColSize");
Row.setColsize(2);
System.out.println("Returning success");
return mapping.findForward("success");
else
ActionErrors errors = new ActionErrors();
errors.add("password",
new ActionError("error.password.mismatch"));
saveErrors(request, errors);
//logonForm.setErrors("LoginError");
return mapping.findForward("failure");
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<!--
This is the Struts configuration file for the example application,
using the proposed new syntax.
NOTE: You would only flesh out the details in the "form-bean"
declarations if you had a generator tool that used them to create
the corresponding Java classes for you. Otherwise, you would
need only the "form-bean" element itself, with the corresponding
"name" and "type" attributes.
-->
<struts-config>
<form-beans>
<!-- Logon form bean -->
<form-bean name="logonForm"
type="LogonForm"/>
<form-bean name="tableForm"
type="TableForm"/>
<form-bean name="profileForm"
type="ProfileForm"/>
</form-beans>
<global-forwards>
<forward name="success" path="/Profile.jsp"/>
</global-forwards>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<!-- Edit user registration -->
<action path="/logon"
type="LogonAction"
name="logonForm"
scope="request"
validate="false"
input="/Test.jsp">
<forward name="success" path="/Table.jsp"/>
<forward name="failure" path="/Test.jsp"/>
</action>
<action path="/table"
type="TableAction"
name="tableForm"
scope="request"
validate="false">
<forward name="success" path="/Bean.jsp"/>
<forward name="failure" path="/Table.jsp"/>
</action>
<action path="/profile"
type="ProfileAction"
name="profileForm"
scope="request"
validate="false"
parameter="method">
<forward name="edit" path="/EditProfile.jsp"/>
<forward name="show" path="/Profile.jsp"/>
</action>
</action-mappings>
</struts-config>
Test.jsp
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<html:form action="/logon" >
<center>
<table>
<tr>
<td> Username </td>
<td> <html:text property="username" size="16" maxlength="16"/> </td>
<td> <html:errors property="username" /> </td>
</tr>
<tr>
<td> Password </td>
<td> <html:password property="password" size="16" maxlength="16"
redisplay="false"/> </td>
<td><html:errors property="password" /> </td>
</tr>
</table>
</center>
<center> <html:submit property="submit" value="Submit"/> </center>
</html:form>
</html:html>
Table.jsp
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<html:form action="/table" >
<center>
<table>
<tr>
<td> <html:text property="rows[0].columns[0].value" /> </td>
<td> <html:text property="rows[0].columns[1].value" /></td>
</tr>
<tr>
<td> <html:text property="rows[1].columns[0].value" /> </td>
<td> <html:text property="rows[1].columns[1].value" /></td>
</tr>
</table>
</center>
<center> <html:submit property="submit" value="Submit"/> </center>
</html:form>
</html:html>The above application runs only with JDK1.3.1_02 and not with any other version. This application is creating dynamic table using struts.
Can anybody help me on the same
also appending web.xml contents:
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--Welcome file list starts here -->
<welcome-file-list>
<welcome-file>
/test.jsp
</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
validate-rules.xml
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
<!--
This file contains the default Struts Validator pluggable validator
definitions. It should be placed somewhere under /WEB-INF and
referenced in the struts-config.xml under the plug-in element
for the ValidatorPlugIn.
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
These are the default error messages associated with
each validator defined in this file. They should be
added to your projects ApplicationResources.properties
file or you can associate new ones by modifying the
pluggable validators msg attributes in this file.
# Struts Validator Error Messages
errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.
errors.byte={0} must be a byte.
errors.short={0} must be a short.
errors.integer={0} must be an integer.
errors.long={0} must be a long.
errors.float={0} must be a float.
errors.double={0} must be a double.
errors.date={0} is not a date.
errors.range={0} is not in the range {1} through {2}.
errors.creditcard={0} is an invalid credit card number.
errors.email={0} is an invalid e-mail address.
-->
<form-validation>
<global>
<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
msg="errors.required">
<javascript><![CDATA[
function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (trim(value).length == 0) {
if (i == 0) {
focusField = field;
fields[i++] = oRequired[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
// Trim whitespace from left and right sides of s.
function trim(s) {
return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
]]>
</javascript>
</validator>
<validator name="requiredif"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequiredIf"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"
msg="errors.required">
</validator>
<validator name="minlength"
classname="org.apache.struts.validator.FieldChecks"
method="validateMinLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.minlength">
<javascript><![CDATA[
function validateMinLength(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oMinLength = new minlength();
for (x in oMinLength) {
var field = form[oMinLength[x][0]];
if (field.type == 'text' ||
field.type == 'textarea') {
var iMin = parseInt(oMinLength[x][2]("minlength"));
if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
if (i == 0) {
focusField = field;
fields[i++] = oMinLength[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
}]]>
</javascript>
</validator>
<validator name="maxlength"
classname="org.apache.struts.validator.FieldChecks"
method="validateMaxLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.maxlength">
<javascript><![CDATA[
function validateMaxLength(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oMaxLength = new maxlength();
for (x in oMaxLength) {
var field = form[oMaxLength[x][0]];
if (field.type == 'text' ||
field.type == 'textarea') {
var iMax = parseInt(oMaxLength[x][2]("maxlength"));
if (field.value.length > iMax) {
if (i == 0) {
focusField = field;
fields[i++] = oMaxLength[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
}]]>
</javascript>
</validator>
<validator name="mask"
classname="org.apache.struts.validator.FieldChecks"
method="validateMask"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.invalid">
<javascript><![CDATA[
function validateMask(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oMasked = new mask();
for (x in oMasked) {
var field = form[oMasked[x][0]];
if ((field.type == 'text' ||
field.type == 'textarea') &&
(field.value.length > 0)) {
if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
if (i == 0) {
focusField = field;
fields[i++] = oMasked[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
function matchPattern(value, mask) {
return mask.exec(value);
}]]>
</javascript>
</validator>
<validator name="byte"
classname="org.apache.struts.validator.FieldChecks"
method="validateByte"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.byte"
jsFunctionName="ByteValidations">
<javascript><![CDATA[
function validateByte(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oByte = new ByteValidations();
for (x in oByte) {
var field = form[oByte[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
if (!isAllDigits(value)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oByte[x][1];
} else {
var iValue = parseInt(value);
if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
if (i == 0) {
focusField = field;
fields[i++] = oByte[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
}]]>
</javascript>
</validator>
<validator name="short"
classname="org.apache.struts.validator.FieldChecks"
method="validateShort"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.short"
jsFunctionName="ShortValidations">
<javascript><![CDATA[
function validateShort(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oShort = new ShortValidations();
for (x in oShort) {
var field = form[oShort[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
if (!isAllDigits(value)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oShort[x][1];
} else {
var iValue = parseInt(value);
if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
if (i == 0) {
focusField = field;
fields[i++] = oShort[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
}]]>
</javascript>
</validator>
<validator name="integer"
classname="org.apache.struts.validator.FieldChecks"
method="validateInteger"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.integer"
jsFunctionName="IntegerValidations">
<javascript><![CDATA[
function validateInteger(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oInteger = new IntegerValidations();
for (x in oInteger) {
var field = form[oInteger[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
if (!isAllDigits(value)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oInteger[x][1];
} else {
var iValue = parseInt(value);
if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
if (i == 0) {
focusField = field;
fields[i++] = oInteger[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
function isAllDigits(argvalue) {
argvalue = argvalue.toString();
var validChars = "0123456789";
var startFrom = 0;
if (argvalue.substring(0, 2) == "0x") {
validChars = "0123456789abcdefABCDEF";
startFrom = 2;
} else if (argvalue.charAt(0) == "0") {
validChars = "01234567";
startFrom = 1;
} else if (argvalue.charAt(0) == "-") {
startFrom = 1;
for (var n = startFrom; n < argvalue.length; n++) {
if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
return true;
}]]>
</javascript>
</validator>
<validator name="long"
classname="org.apache.struts.validator.FieldChecks"
method="validateLong"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.long"/>
<validator name="float"
classname="org.apache.struts.validator.FieldChecks"
method="validateFloat"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.float"
jsFunctionName="FloatValidations">
<javascript><![CDATA[
function validateFloat(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oFloat = new FloatValidations();
for (x in oFloat) {
var field = form[oFloat[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
// remove '.' before checking digits
var tempArray = value.split('.');
var joinedString= tempArray.join('');
if (!isAllDigits(joinedString)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oFloat[x][1];
} else {
var iValue = parseFloat(value);
if (isNaN(iValue)) {
if (i == 0) {
focusField = field;
fields[i++] = oFloat[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
}]]>
</javascript>
</validator>
<validator name="double"
classname="org.apache.struts.validator.FieldChecks"
method="validateDouble"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.double"/>
<validator name="date"
classname="org.apache.struts.validator.FieldChecks"
method="validateDate"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.date"
jsFunctionName="DateValidations">
<javascript><![CDATA[
function validateDate(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oDate = new DateValidations();
for (x in oDate) {
var value = form[oDate[x][0]].value;
var datePattern = oDate[x][2]("datePatternStrict");
if ((form[oDate[x][0]].type == 'text' ||
form[oDate[x][0]].type == 'textarea') &&
(value.length > 0) &&
(datePattern.length > 0)) {
var MONTH = "MM";
var DAY = "dd";
var YEAR = "yyyy";
var orderMonth = datePattern.indexOf(MONTH);
var orderDay = datePattern.indexOf(DAY);
var orderYear = datePattern.indexOf(YEAR);
if ((orderDay < orderYear && orderDay > orderMonth)) {
var iDelim1 = orderMonth + MONTH.length;
var iDelim2 = orderDay + DAY.length;
var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
if (iDelim1 == orderDay && iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
} else if (iDelim1 == orderDay) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
} else if (iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
} else {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
var matched = dateRegexp.exec(value);
if(matched != null) {
if (!isValidDate(matched[2], matched[1], matched[3])) {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else if ((orderMonth < orderYear && orderMonth > orderDay)) {
var iDelim1 = orderDay + DAY.length;
var iDelim2 = orderMonth + MONTH.length;
var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
if (iDelim1 == orderMonth && iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
} else if (iDelim1 == orderMonth) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
} else if (iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
} else {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
var matched = dateRegexp.exec(value);
if(matched != null) {
if (!isValidDate(matched[1], matched[2], matched[3])) {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else if ((orderMonth > orderYear && orderMonth < orderDay)) {
var iDelim1 = orderYear + YEAR.length;
var iDelim2 = orderMonth + MONTH.length;
var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
if (iDelim1 == orderMonth && iDelim2 == orderDay) {
dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
} else if (iDelim1 == orderMonth) {
dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
} else if (iDelim2 == orderDay) {
dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
} else {
dateRegexp = new Reg -
Configuring the PATH for jdk1.3.1_01 in WindowsXP
I need help in configuring the autoexec.bat file for jdk1.3.1_01 . I am running on WindowsXP. (I used to have win 98 on my old pc that crashed and had jdk1.2.1 and working just fine) Now I have a new pc and have tried the following:
windir=C:\WINDOWS
SET winbootdir=C:\WINDOWS
SET COMSPEC=C:\WINDOWS\COMMAND.COM
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\jdk1.3.1_01\bin
SET PROMPT=$p$g
SET TEMP=C:\WINDOWS\TEMP
SET TMP=C:\WINDOWS\TEMP
When I type in C:\path ...it does not show the path I entered. I have no clue what I am doing and the instructions I printed out from sun just do not help me out at all. I really need to get this working so I can continue learning. If anyone can please straighten me out on this I would really appreciate it. Feel free to email me at [email protected]
Thanks RebaYour PATH appears to be correct. However, to verify your PATH you should be able to type the following:
c:\>echo %PATH%
This will display your PATH setting on the console. In addition, you can verify that your PATH setting is correct by typing:
c:\>java -version
If your path is set correctly, you should see something like:
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
If, instead, you get something like:
"Bad command or file name"
Then your PATH is not configured correctly.
Hope this helps. -
HTTPS from JDK1.2.1 to JDK 1.4.1
We are trying to connect application running on JDK1.2.1 to application in JDK 1.4.1. Both applications are in Oracle 9ias application server but with different JDK and different physical machines.
We are getting following error while trying to access to application on JDK 1.4.1
java.lang.ArrayStoreException
at java.lang.System.arraycopy(System.java)
at java.util.Vector.copyInto(Vector.java)
at com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.c(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.<init>(DashoA6275
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.b(DashoA6275)
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.a(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(Da
shoA6275)
at Perc939CallServlet.callServlet(Perc939CallServlet.java:103)
We are using Entrust certificate and we already put cacerts file from jdk1.4 to jdk1.2.1 in jdk/jre/lib/security.
This application was working till we upgraded version from 1.3.1 to 1.4.1.
Is this is problem of 1.4.1 and how do we resolve this?
Small code that will help is as follows
//Dynamic registration of SunJSSE provider
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("ssl.SocketFactory.provider", "com.sun.net.ssl.internal.ssl.Provider");
//Create a URL object from the sURL String representation.
uRemoteURL = new URL(sURL);
//Get a connection to the remote object referred to by the URL
ucConn = uRemoteURL.openConnection();
//Set the DoOutput flag to true to use the URL connection for output
ucConn.setDoOutput(true);
ucConn.setRequestProperty("Pragma", "no-cache");
oosToWrite = new ObjectOutputStream(ucConn.getOutputStream());
//Write sInputString to the OutputStream which will be read from the remote servlet
oosToWrite.writeObject(sInputString);
oosToWrite.flush();
oosToWrite.close();
ucConn.connect();
System.out.println("Connection " + ucConn.toString());
if(ucConn==null)
System.out.println("Connection is Null");
System.out.println("getInputStream " + ucConn.getInputStream());
if(ucConn.getInputStream()==null)
System.out.println("ucConn.getInputStream() is Null");
// Read the string object from the InputStream and return
oisToRead = new ObjectInputStream(ucConn.getInputStream());
Object oReadObject = oisToRead.readObject();
sOutputString = oReadObject.toString();
oisToRead.close();
return (sOutputString);Basically ArrayStoreException comes :
Indicate that an attempt has been made to store the wrong type of object into an array of objects.
But in jdk1.4.1 it is said that
No usage of java.lang.ArrayStoreException
it may be problem of jdk1.4.1 and try to upgrade to 1.4.2
Regards,
Anand -
Classes not found when compiling for jdk1.3.1_01 on red hat 7.2
I have just installed jdk1.3.1_01 (rpm) on linux red hat 7.2
I have written a small program to test, however, the compiler isn't able to locate the classes.
import javax.swing.*;
public class JTest {
public static void main( String args[] )
JOptionPane.showMessageDialog( null, "Hello", "Test Dialog",
JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
When compiled it generates the error:
JTest.java:10: error:Variable "JOptionPane" is not defined in current context
I have the path and classpath set to what I think are the correct directory paths.
Any advice would be much appreciated!
Thanks..Sorry, typo in the classpath... but now when I compile
I get error: "segmentation fault" then nothing else.
This also happens when I execute a precompiled app (eg
"java OldApp").This is to do with GLIBC-2.2, I believe. :/ (Pointed out by Niteen. :)
"ulimit -s 2048" should fix this. Adding this line to /etc/profile or your ~/.profile shall automatically run this command every log in.
Bhav
Maybe you are looking for
-
Cannot complete Lync2013 integration because autodiscover/metadata/json/1 does not exist
Hello, I am trying to setup integration between Microsoft Lync 2013 Server and Exchange 2013 Server so that in OWA you can see presence information and also use Instant Messaging. I am able to complete all the steps except for the following line on t
-
How to define the "tab" ,"enter" character in a variable(type c)
I want to use the define the "tab" key and "enter" key in a variable(type c), But I don't know how to write it : for example: data: a1 type c(1). data: a2 type c(1). a1 = ?. " the tab key a2 = ?. " the enter key
-
Hey everyone, I just bought Iwork for my Mac and I basically got it for the work processing (Pages). Like many people, I work in a MS Word world and I was wondering if Pages is an effective substitute?
-
How to export a PDF file from greek language?
It seems that the greek language is not recognised in the export procedure from pdf to word documents... Is there a way I can install it? Thanks in advance. Katerina P.
-
Photoshop CS5 OpenGL support with latest Intel integrated graphics?
Intel's latest "Sandy Bridge" CPUs (Core i5 2500, Core i7 2600, etc.) included much-improved integrated GPUs, thus allowing for systems that do not require a discrete graphics card. Although not suitable for high-end gaming, the specs appear to be m