how to reference a file of higher hierarchy in a java servlet project

i'm trying to implement a basic mvc pattern for a java web app project in netbeans. i have the deployment descriptor (web.xml) correct but i can't seem to redirect to the correct jsp from the java servlet itself. here's the directory of my project folder:

/project
  /src
    /conf
      MANIFEST.MF
    /java
      /ph
        /com
          /client
            /esurvey
              /objects
                /* other .java files */
              /servlets
                ManageSurveysServlet.java
                /* other .java files */
  /build
    /empty
    /web
     index.jsp
     manage_surveys.jsp
     script.js
     style.css
     /META-INF
       context.xml
       MANIFEST.MF
     /WEB-INF
       web.xml
       /classes
         .netbeans_update_resources
         .netbeans_automatic_build
         /ph
           /com
             /client
               /esurvey
                 /objects
                   /* .class files found here */
                 /servlets
                   ManageSurveysServlet.class
                   /* other .class files found here */

a link from index.jsp calls the ManageSurveysServlet which in turn forwards a request object and redirects to manage_surveys.jsp, but given the above directories, i don't know what path/filename to use to reference manage_surveys.jsp with from the servlet. here's the code in the servlet that forwards the request object:

request.setAttribute("surveys", surveys); // surveys is an arraylist
RequestDispatcher dispatcher = request.getRequestDispatcher("manage_surveys.jsp"); // i'm guessing it can't find the jsp
dispatcher.forward(request, response);

UPDATE: web.xml

<?xml version="1.0" encoding="utf-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <servlet>
    <servlet-name>ManageSurveysServlet</servlet-name>
    <servlet-class>ph.com.client.esurvey.servlets.ManageSurveysServlet</servlet-class>
  </servlet>
  <servlet-mapping>
     <servlet-name>ManageSurveysServlet</servlet-name>
     <url-pattern>/ManageSurveys</url-pattern>
  </servlet-mapping>
  <session-config><session-timeout>30</session-timeout></session-config>
  <welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>
</web-app>

Answers


Move manage_surveys.jsp into WEB-INF folder.I think that will be solution.


Need Your Help

preg_replace with similar values

php preg-replace str-replace

I am working on a mentions system and I have run across a problem, when I am looping through and changing the mentions to links, it will replace similar ones such as @tom and @tom123 with the same ...

Excluding prototype in rails 3?

javascript ruby-on-rails-3 prototypejs

In rails 3, when using &lt;%= javascript_include_tag :defaults %&gt;, it includes a number of javascript files include prototype.js to the page.

How can I directly view blobs in MySQL Workbench

mysql mysql-workbench

I'm using MySQL Workbench CE 5.2.30 CE / Rev 6790 . When execute the following statement: