Help coderanch get a
new server
by contributing to the fundraiser

Calanthe Wei

Ranch Hand
+ Follow
since Oct 27, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Calanthe Wei

Then what should I do to avoid this? I am quite new to this stuff. Thank you so much!
Calanthe
22 years ago
Hi,
I am testing the code in the book "Java Developer's guide to servelt and JSP" the part of Applet and Servlet communication.
I am using JBuilder and I am totally lost what's wrong with my setting and I keep getting the error message. Pls help me with it. Thank you so much!
This is the exact code in this book.
package test515;
import com.javaranch.common.*;
// I use the package in Javaranch
// You can find it in this website
// And ObjectServlet is a servlet class in
// that package
class PipelineServlet extends ObjectServlet{
public Object doObject(Object obj){
String old = (String)obj;
String s = "";
for(int i = old.length() -1;i>=0; i--){
s+= old.charAt(i);
}
return s;
}
}
What I do is set up a project and import the com.javaranch.common package inthis project. And then use servlet wizard to write a servlet as above. The only difference is that it extends ObjectServlet instead of HttpServlet
Here is the web.xml
I think maybe there's something wrong with this
But i don't know what's it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>pipelineservlet</servlet-name>
<servlet-class>test515.PipelineServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>pipelineservlet</servlet-name>
<url-pattern>/pipelineservlet</url-pattern>
</servlet-mapping>
</web-app>
The error message is like
Error: 500 Location: /pipelineservletInternal Servlet Error:java.lang.IllegalAccessException: test515.PipelineServlet
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:268)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Thank you in advance!
Calanthe
22 years ago
Hi, Bill
Thank you very much!
Would you please tell me the difference between these two methods, I mean the login data stored in database or in XML file? Which one is much better?
Thanks again.
Calanthe
22 years ago
Hi,
I have a question about the XML security. I want to set up a login sevelt and want to use a XML file to process data (the user login name and password) instead of a Database. But I was told that using XML could cause security problem.
Can anyone give me some idea about it? Coz I will use XML to handle other part data once the user login. Any way out to avoid such security problem?
Thank you very much in advance.
Calanthe
22 years ago
Hi, all
I have trouble with Class.forName() to load class dynamically. This is a coed used in dispatch service.
My code is like
Class c = Class.forName(methodList.get(myMethod));
methodList is an instance of class that maintain the list of key/value. for example myMethod (key) TestMethod(value)
Can anyone gibe me some hint what's the possible reason that it cannot find the dynamic class?
Thank you so much!

The error is:
java.lang.ClassNotFoundException: TestMethod
at org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:524)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at pointclickweb.servlet.Servlet.service(Servlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
----Calanthe
22 years ago
Hi, Brain
Thank you so much!
Yes, I want a return in the form of an applet.
What I want to do is to creat a login servlet, and this is already done.After the user's login is verified, I want it bring the user an applet,
so that the user can communicate with the server (say editing the file in his folder on the server side)through the applet. And the applet is
almost done.
Any advice or comments on this?Thank you.
Calanthe
22 years ago
Hi, all
I am new here and I have a question about servlet.
Is that possibile the server can retun a applet instead of html file to the client?
Is yes, how can I do that?
Thank you in advance.
Calanthe
22 years ago
Hi,
I have a question:I want to return a webpage from the server to the client. The client is an applet.
Can I do this one? Any idea?
Thank you very mcuh!
Calanthe
22 years ago
Hi,
I am new here and I have trouble with the setting up of tomcat.
I followed all the procedure described in
http://www.moreservlets.com/Using-Tomcat-4.html
But when come to compile and test servlets.
I cannot find classes folder under WEB-INF(install_dir/webapps/ROOT/WEB-INF/classes)There's only one file web.xml.
Here's my situation:
Win NT, Apache Tomcat 4.0, jdk1.3.1
Can anyone give me some idea what's wrong with my setting?Thank you so much!
Calanthe
22 years ago
Hi,Manfred
You clear my doubt.Thank you very much!
Calanthe
22 years ago
Hi,
I want to set up a interface to communicate with the server. Such as load file from the server, edit or save the file to the server.
I use swing to set up the interface but I don't know I should make the program an applet or appliction. It seemed that applet is more restrictive than application for this operation.
Any suggestion? I really appreciate it.
Calanthe
22 years ago
Yes, I just want to know how other people think of this new package.
22 years ago
Hi, All
I build up a frame with swing and want to change the Sun java icon on the left top of the frame to other image. Did anyone happen to know how to do that?
I really appreciate it.

Calanthe
22 years ago
Hi, Can anyone give me some comments on JWSDP?
Thank you very much!
Calanthe
22 years ago
Just one more question, How can I change the font face in that html line? I find the font face on that text cannot be change even though I add
"<html> <font face = morden> try</font></html>"
Can anyone will me some idea? Thank you in advance!
Calanthe
22 years ago