| Author |
Tomcat -why so fiddly?
|
Steven Broadbent
Ranch Hand
Joined: Dec 10, 2002
Posts: 400
|
|
why is it so fiddly to get a new webapp working in tomcat? I can get stuff to work inside an existing app like examples but when I move it into it's own structure webapps/myapp/WEB-INF/web.xml webapps/myapp/WEB-INF/classes/classes in here.... webapps/myapp/jsps in here webapps/myapp/lib/nothing needed in this case This just does not work, if this is the default set up for a new webapp why is not picked up even after restarting the server? End of Rant....thanks
|
"....bigmouth strikes again, and I've got no right to take my place with the human race...."<p>SCJP 1.4
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56152
|
|
Moving to the Tomcat forum. bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56152
|
|
You didn't mention a Tomcat version. I've never had any such problems using the 3.2.x and 4.1.x versions. bear
|
 |
Ray Stojonic
Ranch Hand
Joined: Aug 08, 2003
Posts: 326
|
|
|
In addition to setting up the new app and its directory in webapps, you also need to add a new context tag to the server.xml in tomcat/conf to let tomcat know that its there and what to do with it.
|
 |
Steven Broadbent
Ranch Hand
Joined: Dec 10, 2002
Posts: 400
|
|
tried to hack one in using the examples already in there, but Tomcat wouldn't start. Have put server.xml back to it's original state now- can't find example of how to add context element in the documentation anywhere.
|
 |
Steven Broadbent
Ranch Hand
Joined: Dec 10, 2002
Posts: 400
|
|
Adding this to server.xml and it works:- <Context path="/worple" docBase = "C:\Program Files\Apache Group\Tomcat 4.1\webapps\worple" debug="0" reloadable="true" crossContext="true"/> webapps/worple has a single jsp and an empty WEB-INF directory. This works via localhost:8080/worple/x.jsp Guess this is the minimal set up for a new app.
|
 |
Ray Stojonic
Ranch Hand
Joined: Aug 08, 2003
Posts: 326
|
|
That's a good start link to tomcat server config reference Review the server logs to see what the problem is with your myapp app, I suspect tomcat can't load it for some reason...or it choked on your hacked context
|
 |
 |
|
|
subject: Tomcat -why so fiddly?
|
|
|