The Artima Developer Community
Sponsored Link

Java Answers Forum
how to execute a servlet program through the browser

4 replies on 1 page. Most recent reply: Jun 4, 2003 8:14 AM by jayasimha

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
geethavasan

Posts: 12
Nickname: geetha
Registered: Dec, 2002

how to execute a servlet program through the browser Posted: Jun 3, 2003 4:46 AM
Reply to this message Reply
Advertisement
hello
i have a simple servlet program compiled. i have stored it under webapps/examples/classes.

i need to execute the program.
i am using tomcat as my server.

i have given as
http://localhost:8080/Servletexample

but it gives as the requested resource not available

will anyone of you please help me


Yakov

Posts: 3
Nickname: yakov
Registered: Jun, 2003

Re: how to execute a servlet program through the browser Posted: Jun 3, 2003 8:17 AM
Reply to this message Reply
copy your class into webapps/WEB-INF/classes

Yakov

> hello
> i have a simple servlet program compiled. i have stored it
> under webapps/examples/classes.
>
> i need to execute the program.
> i am using tomcat as my server.
>
> i have given as
> http://localhost:8080/Servletexample
>
> but it gives as the requested resource not available
>
> will anyone of you please help me

geethavasan

Posts: 12
Nickname: geetha
Registered: Dec, 2002

Re: how to execute a servlet program through the browser Posted: Jun 3, 2003 9:43 PM
Reply to this message Reply
hi Yakov,

thanks for replying to my message
i have followed your instructions
but please tell me what exactly i need to give at the browser to execute this program.

i had given as
http://localhost:8080/SampleServlet

i got the error as
the requested resource is not available

could u please help me

thanks & Regards
geetha

Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: how to execute a servlet program through the browser Posted: Jun 4, 2003 4:17 AM
Reply to this message Reply
The best thing would be to read the documentation that comes with tomcat and how to execute the sample programs.

jayasimha

Posts: 1
Nickname: jprasad
Registered: Jun, 2003

Re: how to execute a servlet program through the browser Posted: Jun 4, 2003 8:14 AM
Reply to this message Reply
Hi geetha,
create a servlet entry and servlet url mapping in your web.xml file
<servlet>
<servlet-name>SampleServlet</servlet-name>
<description> Sample Description</description>
<servlet-class>SampleServlet</servlet-class>
</servlet>
< servlet-mapping>
<servlet-name>SampleServlet</servlet-name>
<url-pattern>/SampleServlet</url-pattern>
</servlet-mapping>
after pasting this settings restart tomcat and you can access your servlet by providing
http://localhost:8080/SampleServlet
jay

Flat View: This topic has 4 replies on 1 page
Topic: need an opinion Previous Topic   Next Topic Topic: Function help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use