Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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
  • 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
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which URL are you accessing, exactly?
 
Wellington Carvalho
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
Pie
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What tool is that?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic