Li Yi

Greenhorn
+ Follow
since Jun 21, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Li Yi

According to API:
"The equals method for class Object ... is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true)."
Object m1 = new Object();
Object m2 = new Object();
Although m1, m2 created in the same way, they are not the same object.
Sorry misunderstood your question, if you are trying to redirect index.html to index.jsp, instead of building symbolic link, just do this in index.html:
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=index.jsp">
The index.html would be something like this:
<html>
<head>
<title></title>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=index.jsp">
</head>
<body>
</body>
</html>
19 years ago
I normally just pass along a value when calling from different pages to a particuliar jsp page, then get the value from this page, if/switch to do different task accordingly.
19 years ago
It seems like either you do not have a JSP engine, or you didn't tell the webserver passing jsp file to JSP engine.
If your html page has no jsp involved then why would you want to change to JSP file?
19 years ago
web application in JSP, name on page contains sigle quote, such as O'Brain does not work, when click on it, instead of going to another jsp page, it'll simply gives "Error on Page" at the bottom left conner and do nothing. All name has been encoded:
login.jsp?name=<%= java.net.URLEncoder.encode(name) %>
view source would see:
login.jsp?name=O%2527Brain%2B

It works on the current IE 5.5, also netscape, Opera, AOL...., only shows problem on lower version IE, such as 5.0. Does anybody know how to workaround this problem instead of asking all users to update IE?
19 years ago
B b = new B("Test");
This causes class B to be initialized, but before that, it needs to initialize B's direct superclass A, since no constructor was called in A, it uses the default: A(), which in turn calls constructor A(String s,String t) because of the signature used, which in turn calls another constructor A(String s) because of the signature, which then prints "12". when it finally back to class B, constructor B(String s) is called also because of signature, which then prints "test".
According to java language specification: "Before a class is initialized, its direct superclass must be initialized"
[This message has been edited by Li Yi (edited June 22, 2001).]
I tried both java 1.2 on win NT and 1.2, 1.3, even 1.18 on HPUX, they all compile/run fine without any warning/error:
$ javac test.java
$ java test
a
according to Java Language Specification:
"the value 1 is added to the value of the variable and the sum is stored back into the variable... The value of the postfix increment expression is the value of the variable before the new value is stored"
Therefore after i++, even i has the value of 1, but i++ is still has value of 0, i=i++ just reassigned 0 back to i.
Hope that explains.


[This message has been edited by Li Yi (edited June 22, 2001).]