About Tomcat default application

S

Sameer

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
 
W

William Brogden

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

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?
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

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

Juha Laiho

Sameer 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.
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?

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.
 
S

Sameer

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.
 
I

IchBin

Sameer said:
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.
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-)
 
Joined
Feb 24, 2009
Messages
1
Reaction score
0
I would like to set an application as TomCat default:

My application is itsmpas005:8080/Argo

is it possibile to set Tomcat in order to have argo ad default application?

It would be great if typing in the browser: itsmpas005
Tomcat redirect to: itsmpas005:8080/Argo

I know that to eliminate I have to modify the file server.xml.
Unfortunately I don't know how to make Argo the TomCat default application.

Many thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top