• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Why I can't run a TomCat sample? (webpage is not found)

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to open the Hello World app from tomcat menu:

../apache-tomcat-7.0.11/webapps/examples/servlets/index.html

but it is pointing to a source that does not exist (really does not exist on the filesystem)..

So, am I suppose to compile something before run that example? Or what?

I'm on windows xp, with tomcat 7.
 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see some html files in the path:

C:\Documents and Settings\tombrito\My Documents\Downloads\apache-tomcat-7.0.11\webapps\examples\servlets

..but there are java code on them. Do I need the Java SDK to use TomCat? Or it's just with those samples?

I intend to use TomCat for some javascript programs, not Java.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That source code is just for tutorial purposes - they're the examples this web app is all about. The code comes pre-compiled with Tomcat, though, so you don't need to compile anything.

Tomcat's main point is that it's a servlet container (so it can run servlets and JSPs). If you don't intend to use it for those then there's no point in looking at the example web app. In fact, there isn't much of a point in using Tomcat at all - any web server can serve HTML and JavaScript files.
 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:That source code is just for tutorial purposes - they're the examples this web app is all about. The code comes pre-compiled with Tomcat, though, so you don't need to compile anything.

Tomcat's main point is that it's a servlet container (so it can run servlets and JSPs). If you don't intend to use it for those then there's no point in looking at the example web app. In fact, there isn't much of a point in using Tomcat at all - any web server can serve HTML and JavaScript files.



there are 2 options there: execute and see source

why the execute don't work?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which URL are you accessing, exactly?
 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Which URL are you accessing, exactly?



this:

file:///C:/Documents%20and%20Settings/tombrito/My%20Documents/Downloads/apache-tomcat-7.0.11/webapps/examples/servlets/index.html



The execute option work for you?

I have only the JRE installed, do I need the JDK also? (I'm downloadind the JDK to test..)
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to use the HTTP URL for the servlets to execute; something like http://localhost:8080/examples/servlets/index.html
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, why Tomcat at all? It's totally unnecessary for serving just HTML. Just use the Apache Web Server -- much simpler.
 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Again, why Tomcat at all? It's totally unnecessary for serving just HTML. Just use the Apache Web Server -- much simpler.



Good to know. Unfortunately, the tool I'm using asks for TomCat, so I need it.
 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You need to use the HTTP URL for the servlets to execute; something like http://localhost:8080/examples/servlets/index.html



cool, it worked! Thanks!
 
Bear Bibeault
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What tool is that?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic