Re: servlet help please

2004-02-17 Thread jugal
hi
tell me one thing...that u added the servlet tag in ur web.xml file or 
not...
if not then add it to web.xml file

MessageServlet1
MessageServlet1


try with this...
programme runs???...or not runlet me know
by by
jugal
Jason Tesser wrote:

OK I am new to Tomcat and I am going through one of Sun's courses
regarding Web apps.  I am working on the below example; I have complied
the code ok 
And put it in the servlets-examples/classes.  I also went into the
web.xml File under the servlets-examples directory and added the
following
	
		MessageServlet1
		/servlet/MessageServlet1
	

The problem is when I add the above code to the xml file nothing Under
servlets-examples will run.  What am I doing wrong?
Here is the java code for MessageServlet1 

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// Support classes
import java.io.IOException;
import java.io.PrintWriter;
public class MessageServlet1 extends HttpServlet {

 private static final String[] MESSAGES = {
   "How are you today?",
   "What's in a name? That which we call a rose by any other name would
smell as sweet.",
   "My hovercraft is full of eels."
 };
 public void doGet(HttpServletRequest request,
HttpServletResponse response)
 throws IOException {
   // Pick a random message
   int msg_index = (int) (Math.random() * MESSAGES.length);
   String message = MESSAGES[msg_index];
   response.setContentType("text/html");
   PrintWriter out = response.getWriter();
   out.println("");
   out.println("");
   out.println("Message Servlet");
   out.println("");
   out.println("");
   out.println("The message is: ");
   out.println("" + message + "");
   out.println("");
   out.println("");
   out.close();
 }
}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: servlet help please

2004-02-17 Thread Jason Tesser
Hi,

Yes I got it working.  Thank you all for the help.  
 
> Paste your  and  code here.
> 
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.CEO
> Volume4.Development.Multimedia.Branding
> emotionalize.conceptualize.visualize.realize
> Tel: +27125468436
> Fax: +27125468436
> email:[EMAIL PROTECTED]
> web: www.volume4.com
> 
> This message contains information that is considered to be sensitive
or
> confidential and may not be forwarded or disclosed to any other party
> without the permission of the sender. If you received this message in
> error,
> please notify me immediately so that I can correct and delete the
original
> email. Thank you.
> 
> :: -Original Message-
> :: From: Jason Tesser [mailto:[EMAIL PROTECTED]
> :: Sent: Tuesday, February 17, 2004 9:22 PM
> :: To: Tomcat Users List
> :: Subject: RE: servlet help please
> ::
> :: Hi
> ::
> :: > Howdy,
> :: >
> :: > >
> :: > >MessageServlet1
> :: > >
/servlet/MessageServlet1
> :: > >
> :: > >
> :: > >The problem is when I add the above code to the xml file nothing
> :: Under
> :: > >servlets-examples will run.  What am I doing wrong?
> :: >
> :: > You need to have a  element in your web.xml file
defining
> :: what
> :: > class MessageServlet1 is, e.g.
> :: > 
> :: >   MessageServlet1
> :: >   com.mycompany.SomeServlet
> :: > 
> :: >
> :: > It's preferable to put this servlet element before the servlet-
> mapping
> :: > one ;)
> :: >
> :: > Yoav Shapira
> :: >
> :: ok got it :-)  Thanks now I am getting the following error
> ::
> :: HTTP Status 500 -
> ::
> ::
---
> -
> :: 
> ::
> :: type Exception report
> ::
> :: message
> ::
> :: description The server encountered an internal error () that
prevented
> :: it from fulfilling this request.
> ::
> :: exception
> ::
> :: javax.servlet.ServletException: No servlet class has been specified
for
> :: servlet MessageServlet1
> ::
> ::
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
> :: Base.java:509)
> ::
> ::
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :: :164)
> ::
> ::
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
> ::
> ::
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
> :: 8)
> ::
> ::
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
> :: onnection(Http11Protocol.java:700)
> ::
> ::
>
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
> :: 4)
> ::
> ::
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
> :: .java:683)
> ::java.lang.Thread.run(Thread.java:534)
> ::
> ::
> :: note The full stack trace of the root cause is available in the
Tomcat
> :: logs.
> ::
> ::
-
> :: To unsubscribe, e-mail: [EMAIL PROTECTED]
> :: For additional commands, e-mail:
[EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: servlet help please

2004-02-17 Thread Schalk
Paste your  and  code here.

Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.CEO
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.com
 
This message contains information that is considered to be sensitive or
confidential and may not be forwarded or disclosed to any other party
without the permission of the sender. If you received this message in error,
please notify me immediately so that I can correct and delete the original
email. Thank you. 

:: -Original Message-
:: From: Jason Tesser [mailto:[EMAIL PROTECTED]
:: Sent: Tuesday, February 17, 2004 9:22 PM
:: To: Tomcat Users List
:: Subject: RE: servlet help please
:: 
:: Hi
:: 
:: > Howdy,
:: >
:: > >  
:: > >  MessageServlet1
:: > >  /servlet/MessageServlet1
:: > >  
:: > >
:: > >The problem is when I add the above code to the xml file nothing
:: Under
:: > >servlets-examples will run.  What am I doing wrong?
:: >
:: > You need to have a  element in your web.xml file defining
:: what
:: > class MessageServlet1 is, e.g.
:: > 
:: >   MessageServlet1
:: >   com.mycompany.SomeServlet
:: > 
:: >
:: > It's preferable to put this servlet element before the servlet-mapping
:: > one ;)
:: >
:: > Yoav Shapira
:: >
:: ok got it :-)  Thanks now I am getting the following error
:: 
:: HTTP Status 500 -
:: 
:: 
:: 
:: 
:: type Exception report
:: 
:: message
:: 
:: description The server encountered an internal error () that prevented
:: it from fulfilling this request.
:: 
:: exception
:: 
:: javax.servlet.ServletException: No servlet class has been specified for
:: servlet MessageServlet1
:: 
:: org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
:: Base.java:509)
:: 
:: org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:: :164)
:: 
:: org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
:: 
:: org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
:: 8)
:: 
:: org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
:: onnection(Http11Protocol.java:700)
:: 
:: org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
:: 4)
:: 
:: org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
:: .java:683)
::  java.lang.Thread.run(Thread.java:534)
:: 
:: 
:: note The full stack trace of the root cause is available in the Tomcat
:: logs.
:: 
:: -
:: To unsubscribe, e-mail: [EMAIL PROTECTED]
:: For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: servlet help please

2004-02-17 Thread Shapira, Yoav

Howdy,

>javax.servlet.ServletException: No servlet class has been specified for
>servlet MessageServlet1

Post the  and  elements from your amended
web.xml.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: servlet help please

2004-02-17 Thread Jason Tesser
Hi

> Howdy,
> 
> > 
> > MessageServlet1
> > /servlet/MessageServlet1
> > 
> >
> >The problem is when I add the above code to the xml file nothing
Under
> >servlets-examples will run.  What am I doing wrong?
> 
> You need to have a  element in your web.xml file defining
what
> class MessageServlet1 is, e.g.
> 
>   MessageServlet1
>   com.mycompany.SomeServlet
> 
> 
> It's preferable to put this servlet element before the servlet-mapping
> one ;)
> 
> Yoav Shapira
> 
ok got it :-)  Thanks now I am getting the following error

HTTP Status 500 - 




type Exception report

message 

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception 

javax.servlet.ServletException: No servlet class has been specified for
servlet MessageServlet1

org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:509)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:164)

org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
8)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:700)

org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
4)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:683)
java.lang.Thread.run(Thread.java:534)


note The full stack trace of the root cause is available in the Tomcat
logs.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: servlet help please

2004-02-17 Thread Shapira, Yoav

Howdy,

>   
>   MessageServlet1
>   /servlet/MessageServlet1
>   
>
>The problem is when I add the above code to the xml file nothing Under
>servlets-examples will run.  What am I doing wrong?

You need to have a  element in your web.xml file defining what
class MessageServlet1 is, e.g.

  MessageServlet1
  com.mycompany.SomeServlet


It's preferable to put this servlet element before the servlet-mapping
one ;)

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]