• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Question reg Tomat5.0/Apache

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have couple of questions.

1. I know tomcat is a JSP/Servlet engine used to run my jsp/servlet's and Apache is a web-server. I have Tomcat5.0 installed couple of days back. I did some configuration in the web.xml file to change the default http-port from 8080 to 8021. Does tomcat5.0 come with Apache built-in OR when I execute the pages am i executing directly from the engine. I am not able to sink in the true difference betn an engine and a web-server. I have seen couple of posts regarding connecting tomcat with apache/IIS, why do we need it?( It might be a very beSICK question, but I want to know about it)

2. I tried to run my servlets and get this error(with tomcat 5).


HTTP Status 404 - /servlet/coreservlets.HelloWorld

type Status report

message /servlet/coreservlets.HelloWorld

description The requested resource (/servlet/coreservlets.HelloWorld) is not available.



But when i configure web.xml and then run it, it works fine. Do i need configure web.xml everytime I run new servlets. OR Is there a better way.

Thanks a lot,
Kits
Apache Tomcat/5.0.28
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kitty,

Sailing in the same boat. I too am tryin to differentiate between Tocat and Apache.....

As far as I know, Servlets need to be mapped in the Web.xml file, with their respective classes. So, if u write a new servlet into ur application, you have to enter the details into ur web.xml for that application.

All the more, once entereed, it need not be altered for successive runs.

Say, your servlet is MyServlet.java. You compile and get MyServlet.class

Now, in ur web.xml, u have to tell Tomcat, which is the servlet class to load? and what is the name and the URL Pattern, to call the servlet. All these are mandatory entries for the servlets.

HTTP Status 404 - /servlet/coreservlets.HelloWorld

type Status report

message /servlet/coreservlets.HelloWorld

description The requested resource (/servlet/coreservlets.HelloWorld) is not available.



Such an error occurs for me due to some error in the mapping. A new Servlets need to be mapped.

Well.....
This is what i know, from my side. Any ways, more inputs on this are welcome.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mapping each servlet is the way to go.

the /servlet mapping that no longer works is the 'invoker servlet'. Read about it here:
http://faq.javaranch.com/view?InvokerServlet
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic