Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Simeon Shi

Ranch Hand
+ Follow
since Dec 09, 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 Simeon Shi

I do think that I have got a hint. The log4j's XML digester could only resolve absolute path but not relative path. However, if you want to the relative path due to the web application. You'd better invoke the Servlet's getServletContext().getRealPath("/") to return a String "prefix", which could be used to locate the actual URI of your web resource.
Hi,
I am now using jakarta-tomcat-5.0.14 to test Servlet 2.4 and JSP 2.0 features. But do anyone know how to integrate Tomcat with JBuilder? I tried to copy the existing server configuration, which is Tomcat 4.1 in JBuilder, and reconfigured it. However, it seems helpless! The server stopped without any error messages, even a single printed information. The following is the copied command line appeared in JBuilder when starting Tomcat 5!
C:\JBuilder9\jdk1.4\bin\javaw -classpath "C:\jakarta-tomcat-5.0.14\bin\bootstrap.jar;C:\JBuilder9\jdk1.4\lib\tools.jar" -Dcatalina.home="C:/jakarta-tomcat-5.0.14" org.apache.catalina.startup.Bootstrap -config "C:\Documents and Settings\yanmin.shi\jbproject\web-test\Tomcat\conf\server8080.xml" start
I really appreciate your help. Thanks in advance.
18 years ago
Hi,
I am now using jakarta-tomcat-5.0.14 to test Servlet 2.4 and JSP 2.0 features. But do anyone know how to integrate Tomcat with JBuilder? I tried to copy the existing server configuration, which is Tomcat 4.1 in JBuilder, and reconfigured it. However, it seems helpless! The server stopped without any error messages, even a single printed information. The following is the copied command line appeared in JBuilder when starting Tomcat 5!
C:\JBuilder9\jdk1.4\bin\javaw -classpath "C:\jakarta-tomcat-5.0.14\bin\bootstrap.jar;C:\JBuilder9\jdk1.4\lib\tools.jar" -Dcatalina.home="C:/jakarta-tomcat-5.0.14" org.apache.catalina.startup.Bootstrap -config "C:\Documents and Settings\yanmin.shi\jbproject\web-test\Tomcat\conf\server8080.xml" start
I really appreciate your help. Thanks in advance.
18 years ago
Actually,I made the web.xml by myself in which I didn't assign the <servlet-mapping> tag.
19 years ago
When I type the URL "http://127.0.0.1:8080",the index.jsp in ROOT directory is shown,which means that the index.jsp is the default page in the default root directory "ROOT".My question is how to make a page default?
Thanks in advance.
simeon
19 years ago
First, the following is the physical path of my web application.
...
---BankAccount
└ WEB-INF
│ └classes
│ │ └webapplication
│ │ └AccountServlet.class
│ │ └LoginServlet.class
│ └web.xml
└ login.html

I try to access the URL "http://127.0.0.1:8080/BankAccount/login.html",which the login.html post a request to the servlet LoginServlet which is in the package webapplication.Then the LoginServlet will redirect to the AccountServlet if the login is ok.I use the req.getRequestDispatcher("/AccountServlet").forward(req, res) to get the user's account info.However, the question arised here.In the book, it use the req.getRequestDispatcher("/servlet/AccountServlet").forward(req, res) and also will sucess.It is strange about the /servlet/... What does the path means?I don't have such package or directory.
I tried some other web application then and I found that the path "/servlet/..." all work well.Can anyone help me?
[ September 12, 2002: Message edited by: simeon shi ]
19 years ago
Hi,
Where can i get the PDF version of Sun's official student guid,SL-314? Is that book useful?Thanks in advance.
simeon
hi,
i wanna create a transparent JFrame or JWindow.how could i reach it?is there anybody with experience?
thanks in advance.
19 years ago
hi,everybody,
I read the source code of BasicToggleButtonUI today and confused about it.
As what you see,a JToggleButton has two states.When you pressed the button,
the background color will changed.It remain the background unless you press the
button again.
However, I found that the paint() method and painticon() method are quite similar to
these of BasicButtonUI which is the super class of BasicToggleButtonUI.I could not found
the snippet to keep the background color. Can anybody who is mastered in this to tell me
why?
thx in advancd.
20 years ago
I'd like to create a set of my own Components which appear quite different to the normal.
How could i do?
20 years ago
i wanna use java swing to create a officexp-style
UI,what could i do?
rewrite the paint() method? and how could i create
a new component with my own code?
3x very much for your help.
simeon
20 years ago
i am confused now.why the following code works??
import java.io.*;
public class Test{
public static void main(String[] args) {
try{
InputStream ir = System.in;
System.out.println(ir.read());
} catch(Exception e){
System.out.println("Error!");
}
}
}
the read() method of InputStream is a abstract one which has no body,buy why when i run this snippet,i put in 'h' and the output is the 104
which is the ASCII of h in return.
and more...the InputStream is also a abstract class,how could we use it directly?
can anybody help me ?
thanks in advance!!
simeon
why the following snippet of my source works?
**************************************************
Scribble_Menu_Item = new JMenuItem("Exit",KeyEvent.VK_X);
Scribble_Menu_Item.setIcon(new ImageIcon("../images/Blank.gif"));
Scribble_Menu_Item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{ System.exit(0); }
});
Scribble_Menu_File.add(Scribble_Menu_Item);
**************************************************
the "ActionListener" is an interface which could not be "new"
directly,am i right? but the code compiled fine and run normally.
who can help me?
thanks in advance!
It's a question raised in java.sun.com...however,
i still confuesd with it.Say...the following code:
public class foo implements Runnable {
String query = null;
public foo(String q) {
query = q;
}
public void run() {
System.out.println(query + " hashCode "
+ query.hashCode());
synchronized(query) {
System.out.println("in block");
try {
Thread.sleep(5000);
}
catch (Exception e) {
}
System.out.println("done");
}
}
public static void main(String[] args) {
String str1 = "foo";

char data[] = {'f', 'o', 'o'};
String str2 = new String(data);

new Thread(new foo(str1)).start();
new Thread(new foo(str2)).start();
}
}
it wont' work as we hope unless we replace the
synchronized(query) by synchronized(query.intern()).why will that help?
why the following code will generate an runtime exception?
*******************************************
public class CastTest{
public static void main(String[] args){
Base b = new Base();
Sub s = (Sub)b;
}
}
class Base{}
class Sub extends Base{}
*******************************************
actually,Sub is subclass of class Base.why?
3x in advance