ive made a webapp and im wondering about the configuration of my folder as well as the web.xml file. the webapp uses a MVC architecture, but im not having much success running it on apache tomcat. i dont know whether the problem is the way ive structured my folders, something is missing in my web.xml file, or the way ive referenced it inside my jsp files.
for some example :the way ive referenced it in my jsp files is
<form id="loginform" action="/servlet/ControllerServlet" method="post">
<input type="button" onclick="<% response.sendRedirect("/servlet/ControllerServlet?action=register");%>"></input>
<a href="servlet/ControllerServlet?action=upload" id="upload"><span>Upload a profile photo</span></a>
my folder structure is :
newApp(dir) {
newApp/images(dir)
newApp/temp(dir)
newApp/(all .jsp files)
newApp/WEB-INF(dir){
WEB-INF/web.xml
WEB-INF/lib(dir){
lib/org.apache.commons.jar
WEB-INF/classes(dir){
classes/(all classes including controller servlet)
my web-inf file looks like this:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>AssignmentForum</display-name>
<servlet>
<description>
</description>
<display-name>ControllerServlet</display-name>
<servlet-name>ControllerServlet</servlet-name>
<servlet-class>itc357.ControllerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>/ControllerServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<description>Location to store uploaded file</description>
<param-name>file-upload</param-name>
<param-value>
c:\apache-tomcat-5.5.29\webapps\data\
</param-value>
</context-param>
</web-app>
the message that tomcat gives me when i try to access a jsp page is
type Status report
message /servlet/ControllerServlet
description The requested resource (/servlet/ControllerServlet) is not available.
cheers for any help yall can give, bundy
/ControllerServletinstead of/servlet/ControllerServlet. - Thilo/ControllerServlet- Sathish