tssssssssssssssssss. tomarei bavarias x�caras quando isto funcionar. claro, um brinde a vcs!!!!
- este naum funcionou http://www.mycgiserver.com/servlet/jossobri.HelloWorld
- coloquei o HelloWorld.class dentro de http://www.mycgiserver.com/servlet/~jossobri/WEB-INF , mesmo assim, http://www.mycgiserver.com/servlet/~jossobri/WEB-INF/HelloWord (com e sem ~ no jossobri) naum funcionou
Daniel Quirino Oliveira <[EMAIL PROTECTED]> wrote:
http://www.mycgiserver.com/servlet/~jossobri.HelloWorld t� errado... tire o
~, assim, �:
http://www.mycgiserver.com/servlet/jossobri.HelloWorld
[]'s
daniel
From: Alex Pitacci <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [enterprise-list] meu primeiro servlet. help me!
Date: Tue, 25 Feb 2003 16:24:21 -0300 (ART)
voce realmente vai ter que colocar todas as suas
servlets dentro do diret�rio "root"/web-inf/classes
onde root � diret�rio raiz da sua aplica��o
--- jose soares sobrinho escreveu:
oi pessoas,
primeiro compilei o arquivo HelloWorld.java do endere�o
http://www.mycgiserver.com/~jossobri/HelloWorld.javaimport java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("<HTML>"); out.println("<HEAD><TITLE>Hello World</TITLE></HEAD>"); out.println("<BODY>"); out.println("<BIG>Hello World</BIG>"); out.println("</BODY></HTML>"); } }
utilizando o utilities
java compiler do www.mycgiserver.com, e zazzzzz!!!
apareceu
http://www.mycgiserver.com/~jossobri/HelloWorld.class
depois digitei
http://www.mycgiserver.com/servlet/~jossobri.HelloWorld ,
conforme instru��o do java servlets FAQ� e o resultado foi:500 Servlet Exception
javax.servlet.ServletException: Class `~jossobri' was not found in classpath. Classes normally belong in /WEB-INF/classes. at com.caucho.server.http.Application.instantiateServlet(Application.java:2186) at com.caucho.server.http.Application.createServlet(Application.java:2118) at com.caucho.server.http.Application.loadServlet(Application.java:2091) at com.caucho.server.http.QServletConfig.loadServlet(QServletConfig.java:424) at com.caucho.server.http.Application.getFilterChainServlet(Application.java:1932) at com.caucho.server.http.Application.buildFilterChain(Application.java:1914) at com.caucho.server.http.Invocation.service(Invocation.java:289) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:341) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:268) at com.caucho.server.TcpConnection.run(TcpConnection.java:136) at java.lang.Thread.run(Thread.java:543)
1. I have the source files ready, what now?
The next step is compiling your servlet. You can
compile it online by using 'javac online' in this area.
Another possibility is compiling them on your local
machine. For being able to do so you'll need the
Java Development Kit and Java Servlet Development
Kit (JSDK).
2. How do I start my servlet?
For starting your servlet you need to use the
account path to your servlet in conjunction with the
servlet URL. For example, if you want to execute
helloworld.class the URL would be:
http://www.mycgiserver.com/servlet/USERNAME.helloworld
We used to have a wrapper for being able to call
servlets directly via the classfile, however this is
disabled again as it created a conflict with java applets.
3. My servet is giving me a wrong classname error.
Why?
What you've to take care about is the package name
which has to reflect your username and the path
where the servlet is stored.
Supposing that the username is 'testuser' and the
path where the servlet class is stored is
'apps/work/test.class' (relative to your account
root directory). Your package name would then look
like the following:
testuser.apps.work
Set this package name, compile your servlet again
and it will work.
4. I have my servlets ready in a jar file, how can I
execute them?
You can't! If you want to use jar files with java
you normally have to add the particular archive to
the classpath. However this is not possible in this
case, you can't modify the systems classpath.
If you simply want to be able to use a java class
library stored in a jar which is freely available
through the internet simply let us know and we'll
install it in the main class repository.
5. Do I have my own servlet ZONE?
No, our members are sharing a single zone, the
servlet engine wouldn't be able to cope with such a
huge number of zones otherwise.
6. I want to write into the log with my servlet, how
can I do that?
For writing log entries, use the log function as in
the following example, which will writes the message
'MY PERSONAL LOG ENTRY' into the log:
public void doGet (HttpServletRequest request,
HttpServletResponse response) throws
ServletException, IOException { ...
this.getServletContext().log("MY PERSONAL LOG ENTRY"
+ ": " + request.getServletPath()); ...
If you want to log the content of a variable for
example, the line would look like the following:
String strHelloTo = "World";
this.getServletContext().log(strHelloTo + ": " +
request.getServletPath());
Subject: Meu primeiro servlet Date: 2003-02-25 01:21:17 Author: jose soares sobrinho (jossobri) Read Count: 8 ol� brazucas, bel�?
primeiro compilei o arquivo HelloWorld.java do endere�o http://www.mycgiserver.com/~jossobri/HelloWorld.java utilizando o utilities
java compiler do mycgiserver.com, e zazzzzz!!!
apareceu a classe HelloWorld.class em http://www.mycgiserver.com/~jossobri/HelloWorld.class.
depois digitei http://www.mycgiserver.com/servlet/~jossobri.HelloWorld
resultado:
500 Servlet Exception
javax.servlet.ServletException: Class `~jossobri.HelloWord' was not found
in classpath.
Classes normally belong in /WEB-INF/classes.
at com.caucho.server.http.Application.instantiateServlet(Application.java:2186)
at com.caucho.server.http.Application.createServlet(Application.java:2118)
at com.caucho.server.http.Application.loadServlet(Application.java:2091)
at com.caucho.server.http.QServletConfig.loadServlet(QServletConfig.java:424)
at com.caucho.server.http.Application.getFilterChainServlet(Application.java:1932)
at com.caucho.server.http.Application.buildFilterChain(Application.java:1914)
at com.caucho.server.http.Invocation.service(Invocation.java:289)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:341)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:268)
at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
at java.lang.Thread.run(Thread.java:543)
o que est� acontecendo, como rodar meu primeiro servlet??
[]s1 reply Reply
Subject: Re: Meu primeiro servlet In Reply To: Meu primeiro servlet Date: 2003-02-25 07:31:55 Author: simon copi (vogel) - Valued Project Contributor Read Count: 8 did you make package jossobri ?
put servlet on your root dir
call servlet: http://www.mycgiserver.com/servlet/jossobri.HelloWorld
look at java servlets FAQ1 reply Reply
Subject: Re: Meu primeiro servlet In Reply To: Re: Meu primeiro servlet Date: 2003-02-26 17:21:10 Author: Steve Guo (hotcoffee) Read Count: 4 yes, make package jossobri, not ~jossobri.
~jossobri.HelloWorld0 replies Reply
jose s sobrinho
icq 341548726
tel 55 11 9866 4609
www.mycgiserver.com/~jossobri
Busca Yahoo!
O servi�o de busca mais completo da Internet. O que voc� pensar o Yahoo! encontra.
