Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

About Tomcat default application

Thread view: 
Sameer - 07 Jun 2006 14:13 GMT
Hello,
I have installed Tomcat 5.5 on Windows 2000.
It's default application is located at:
C:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\ROOT\index.jsp

If I put any vaild jsp file like Hello.jsp then I can run it using:
http://localhost:8080/Hello.jsp.

In C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT
directory there is a folder WEB-INF containing web.xml and another
folder LIB.

I have created a folder classes in WEB-INF and I put their the compiled
servlet class file HelloServlet.class.
Why I can't run this servllet using:
http://localhost:8080/servlet/HelloServlet

Is it compulsory to create a deployment descriptor or it is sufficient
to put it in the created classes directory?
What may be the problem in running servlet? How to run it?

How to get rid off from the port 8080? If I set the port to 80 then can
i run the jsp as:
http://localhost/Hello.jsp

Please help.
-Sameer
William Brogden - 07 Jun 2006 15:22 GMT
> Hello,
> I have installed Tomcat 5.5 on Windows 2000.
[quoted text clipped - 13 lines]
> Why I can't run this servllet using:
> http://localhost:8080/servlet/HelloServlet

That usage requires the "Invoker" servlet - which causes lots of trouble
in the long run. See

http://faq.javaranch.com/view?InvokerServlet   for a discussion

> Is it compulsory to create a deployment descriptor or it is sufficient
> to put it in the created classes directory?
[quoted text clipped - 3 lines]
> i run the jsp as:
> http://localhost/Hello.jsp

The port is configured in server.xml - look for a <Connector tag

> Please help.
> -Sameer

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Juha Laiho - 07 Jun 2006 16:04 GMT
"Sameer" <dolpheen@gmail.com> said:
>I have installed Tomcat 5.5 on Windows 2000.
>
>If I put any vaild jsp file like Hello.jsp then I can run it using:
>http://localhost:8080/Hello.jsp.
...
>I have created a folder classes in WEB-INF and I put their the compiled
>servlet class file HelloServlet.class.
[quoted text clipped - 3 lines]
>Is it compulsory to create a deployment descriptor or it is sufficient
>to put it in the created classes directory?

More or less, nowadays you declare your servlets in web.xml . For more info,
read http://faq.javaranch.com/view?InvokerServlet .

Also, prepare to create a package for your classes; unqualified classes as
servlets are a problem.

>How to get rid off from the port 8080? If I set the port to 80 then can
>i run the jsp as:
>http://localhost/Hello.jsp

Port 80 is the default. If you use anything else, you must explicitly show it.
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)

Sameer - 07 Jun 2006 19:20 GMT
Thanks for your(s) post!

Now I am able to run Servlets by uncommenting Servlet Invoker related
tags in web.xml.
But I am facing a strange situation.
I always copy the servlet class files in
C:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\ROOT\WEB-INF\classes directory
I have successfully executed a servlet using the above setting.
Then I changed the source of it a little, recompiled it and copied it
again in the specified directory.
The IExplorer is not reflecting the changes for the same url. I tried
closing and reopening the IExplorer for some times.

Lastly I closed and restarted Tomcat !!!

Now I am getting the desired new output.

Is it necessary to restart Tomcat if we change the class files?
Please clarify.

> "Sameer" <dolpheen@gmail.com> said:
> >I have installed Tomcat 5.5 on Windows 2000.
[quoted text clipped - 26 lines]
>          PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
> "...cancel my subscription to the resurrection!" (Jim Morrison)
IchBin - 07 Jun 2006 23:16 GMT
> Thanks for your(s) post!
>
[quoted text clipped - 45 lines]
>>          PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
>> "...cancel my subscription to the resurrection!" (Jim Morrison)

Yes you have to reload the app to run the later version. You can use the
 Admin program to reload on the fly.

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.