Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

tomcat directory structure

843841Jan 2 2007 — edited Jan 3 2007
I tried to create a web application.
I wanted to use a build.xml in which there was a target that copied my war in the webapps directory of Tomcat.
The project structure was
webapplication <br>
web/jsp
web/web-inf
web-inf/src/servlets/Myservlet

My web.xml was:
<!-- we give name hello to our servlet -->
	<servlet>
		<servlet-name>webapplicationServlet</servlet-name>
		<servlet-class>servlets/MainServlet</servlet-class>
	</servlet>
	<!-- when user provides URL /hello then servlet hello is invoked -->	
	<servlet-mapping>
		<servlet-name>webapplicationServlet</servlet-name>
		<url-pattern>/firstPage</url-pattern>
	</servlet-mapping>
The problem was that the url
http://localhost/webapplication/firstPage was not working while
the url http://localhost/webapplication/page1.jsp was working
The problem was solved after I removed folder web and inside the webapps of the Tomcat the first folder was WEB-INF
.Does anybody has any idea why this was happening?
It is allowed to place web-inf inside another folder right?
Moreover the source coude of the servlet could be anywhere as long as it is copied afterward in web-inf/classes?

Thanking you in advance.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 31 2007
Added on Jan 2 2007
8 comments
250 views