The requested resource (/DBTest/SearchInventory.jsp) is not available.

Hi,
I have a search screen (jsp page) which has four fields to base the search on. Once the "Search" button is clicked, i am going to a servlet which does a select based on the search criteria, and stores the result in a ResultSet object. I then use the setAttribute method to store the result set in a bean. Here is the code for what i've just described:
rs=stmt.executeQuery(QueryStr); //get result set
HttpSession session=req.getSession(true);//create session var
session.setAttribute("s_resbean",rs);//set bean attribute
After this is set, i want to forward/redirect (whatever works...nothin does right now...the reason for this post.) back to the search screen(jsp page), and display the query ResultSet in the bottom half of the screen. I use the following code to do this:
String url="/DBTest/SearchInventory.jsp";
RequestDispatcher dispatcher=getServletContext().getRequestDispatcher(url);
dispatcher.forward(req,res);
Unfortunately, this gives me the following error:
The requested resource (/DBTest/SearchInventory.jsp) is not available.
Why would this be happening?? Is there another way of doing this? I'm just trying to follow the example in chp.15 of the free coreservlets pdf...
Thanks in advance,
Aditya.
P.S. Here is the code for my bean...don't know if it's needed...
public class SearchBean extends HttpServlet{
     private int searchFlag=0;
     private ResultSet searchRS;
     public SearchBean(){
     public int getSearchFlag(){
          return searchFlag;
     public ResultSet getSearchRS(){
          return searchRS;
     public void setSearchRS(ResultSet rs){
          this.searchRS=rs;
     public void setSearchFlag(){
          this.searchFlag=1;
}

I assume DBTest is the context root for your webapp.
ServletRequest.getRequestDispatcher(String url) is looking for a url relative to the context root. Therefore if my assumption is correct you want to use the url /SearchInventory.jsp, removing the DBTest.
HTH.

Similar Messages

  • The requested resource (/mytest/test.jsp) is not available.

    JSP and Java are NEW for me.
    I have prepared Linux server with Tomcat and Apache servers, connect it to using mod_jk.
    Apache and Tomcat are work fine following LINK.
    http://localhost/examples/jsp/
    But , when I access JSP from my folder which I made it same folder "examples" is not working.
    http://localhost/mytest/test.jsp (This is my folder which i want to call all my JSP file.)
    It display following error message:
    Apache Tomcat/4.0.4 - HTTP Status 404 - /mytest/test.jsp
    type Status report
    message /mytest/test.jsp
    description The requested resource (/mytest/test.jsp) is not available.
    What can i do, HELP ME.

    I STILL have some problem with JSP.
    I have prepared Linux server with Tomcat and Apache servers, connect it to using mod_jk.
    Apache and Tomcat are work fine following LINK.
    http://localhost/examples/jsp/
    But , when I access JSP from my folder which I made it same folder "examples" is not working.
    http://localhost/mytest/test.jsp
    (This is my folder which i want to call all my JSP file.)
    It display following error message:
    Apache Tomcat/4.0.4 - HTTP Status 404 - /mytest/test.jsp
    type Status report
    message /mytest/test.jsp
    description The requested resource (/mytest/test.jsp) is not available.
    What can i do, HELP ME ???

  • TS1424 I have downloaded a series of prison break but 3 episodes are saying "you do not have permission to access the requested resource" and "this episode can not be downloaded at this time" any idea how to fix this please??

    I have downloaded a series of prison break but 3 episodes are saying "you do not have permission to access the requested resource" and "this episode can not be downloaded at this time" any idea how to fix this please??

    I got this error with my iPad 3, my wife's iPhone 4, but not with my iPhone 4s.

  • The requested URL /OA_HTML/AppsLocalLogin.jsp was not found

    Dear,
    i was just upgrade the OracleAS 10g Release 3 (10.1.3.0) Patch Set 4 (10.1.3.4.0) and Java 6.0 JDK on this system (ebs r12.0.6) OUL5x64
    and run adautoconfig with no error.
    Before the upgrade the system was fine.
    but when i connect to the URL got this error.
    NOT FOUND the request URL "The requested URL /OA_HTML/AppsLocalLogin.jsp was not found on this server."
    looked into the apache error log and it complained , could not find the file, but i compared with a good system there were no file and DIR OA_HTML/AppsLogin.
    /u01/oracle/CRPXX/inst/apps/CRPXX_xxx/portal/OA_HTML/AppsLogin.
    from Apache error log:
    File does not exist: /u01/oracle/CRPXX/inst/apps/CRPXX_xxx/portal/OA_HTML/AppsLogin.
    Please advise.
    Regards,

    Hi,
    Have a look at this thread.
    Login Page not getting Displayed after 10.1.3 Home Upgrade in R12
    Login Page not getting Displayed after 10.1.3 Home Upgrade in R12
    Regards,
    Hussein

  • The requested resource does not exist - EAR - Jsp

    Hy!
    Following a tutorial I'm trying to create a small application in the Developer Studio.
    I created a Table, an EJB-Project with an Entity Bean and a Stateless Session Bean, a Web-Project with a JSP-File and an EAR which I deployed. Now the JSP form should be available at http://[server-name]:50000/employee/view.
    But I get:
    404   Not Found - SAP J2EE Engine/6.40
    The requested resource does not exist.
    Details:     Go to main page of this application!
    "main page" is a link which refers to http://localhost:50000/index.html which is the SAP Engine Start Page.
    This is my first experience with sap netweaver. So I don't know where I should start to search for the problem or how to solve it.
    In the web.xml of the WebProject there is the following code for the servlet mapping:
    <servlet>
         <servlet-name>NewEmployee.jsp</servlet-name>
         <jsp-file>/NewEmployee.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
         <servlet-name>NewEmployee.jsp</servlet-name>
         <url-pattern>/view</url-pattern>
    </servlet-mapping>
    This is the code in the application.xml of the ear which should make it possible to access the webproject under .../employee.
    <module>
         <web>
              <web-uri>EmployeeWeb.war</web-uri>
              <context-root>employee</context-root>
         </web>
    </module>
    Best Regards,
    Carina

    Hy!
    I tried several changes and found out, I just had to remove the ' / ' bevor NewEmployee.jsp in the jsp-file - tag.
    <servlet>
         <servlet-name>NewEmployee.jsp</servlet-name>
         <jsp-file>NewEmployee.jsp</jsp-file>
    </servlet>
    Now it works and I'm able to test the jsp. There's a form and after a submit a jndi-lookup is performed.
    Object ref=jndiContext.lookup("java:comp/ev/ejb/EmployeeService");
    It seems the EJB reference in the web.xml:
             <ejb-ref>
              <ejb-ref-name>ejb/EmployeeService</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <home>com.sap.bsp.EmployeeServicesHome</home>
              <remote>com.sap.bsp.EmployeeServices</remote>
              <ejb-link>EmployeeEjb.jar#EmployeeServicesBean</ejb-link>
         </ejb-ref>
    doesn't work, because I get:
    com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/ev/ejb/EmployeeService.
    Looking forward to a hint
    Best regards,
    Carina

  • 404 Not Found,   Error: The requested resource does not exist.

    Hi all,
    When I try to access VC with the http://localhost:50400/vc where 04 is the CE1 instance, it returns the following error:
    404 Not Found
      Error: The requested resource does not exist.
    Any clues. Just to add that the CE1 servers are running green and nwa is accessible on same url.
    Regards.

    Hi
    Try with following link (VC should be in Caps) -
    http://localhost:50400/VC/default.jsp
    Also check whether you have proper admin roles assigned to your user id.
    Regards
    Sandeep
    Edited by: Sandeep Patki on Sep 16, 2009 8:47 AM

  • "404 Error - The requested resource does not exist" found in portal for Collaboration room

    Hi Experts,
    I am trying to resolve this issue since a week but not able to solve it, so i need your help.
    The Problem is when i assign a collaboration room to a user, the room is assigned but when the user clicks on the room link it gives the "404 Error - The requested resource doesn't exist". But if a new room is created and give access to the user, the user is able to open the new room through the link and view the documents.
    The Unique thing about the error is, it doesn't occur for every user it happens with few users, since I am the super_admin I am able to view all the rooms without getting such "404 error" even for once.
    I have tried by setting up all the permissions to the room and also assigning Everyone role to the rooms, still the problem persists.
    I am unable to find a solution for this, so need your help.
    Eagerly waiting for your helpful replies.
    Thanks in advance.
    Thanks & Regards,
    Shumana.

    Hi
    Try with following link (VC should be in Caps) -
    http://localhost:50400/VC/default.jsp
    Also check whether you have proper admin roles assigned to your user id.
    Regards
    Sandeep
    Edited by: Sandeep Patki on Sep 16, 2009 8:47 AM

  • Error:  The requested resource does not exist. (Servlet)

    Hello,
    I created a simple JSP(submit form), that calls a servlet. When I run the JSP, I see the form. On submit, I get error screen:
    404   Not Found
    Error: The requested resource does not exist.
      Troubleshooting Guide https://sdn.sap.com/irj/sdn/wiki?path=/display/jsts/home
    Details: Go to main page of this application!
    The URL shows the path to the servlet (fully qualified name of the servlet class)
    http://<host>:50000/WebClient/<path>.ClientServlet
    Logs don't show anything...
    What am I missing here..,

    The servlet mapping was wrong in web.xml(missed the package.name)

  • "The requested resource (/hello) is not available"  Error of Servlet

    Hello all,
    I get HTTP STATUS 404 Error which states "The requested resource (/hello) is not available" even thought according to me I am doing everything perfectly.
    Here is more information. If you can find out where the proble might be please
    let me know because I am working on this for more than 9 hours.
    I AM USING-<br>
    TOMCAT 5.5.26 <br>
    JRE 6 <br>
    J2SDK 1.4.0 <br>
    </B>
    <BR><BR>
    SYSTEM VARIABLES :<br>
    <B>
    CLASSPATH
    </B>
    C:\apache-tomcat-5.5.26\common\lib\servlet-api.jar <BR>
    <B> JAVA_HOME</B> D:\j2sdk1.4.0
    <BR>
    <B>JRE_HOME</B> C:\Program Files\Java\jre6
    <BR>
    <B>TOMCAT_HOME </B>C:\apache-tomcat-5.5.26
    <BR>
    <P>
    I have placed my hello.class file inside
    <b>C:\apache-tomcat-5.5.26\webapps\ROOT\WEB-INF\classes</b>
    also, i have modified web.xml file as<br>
    <b>
    <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>hello</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>hello</url-pattern>
    </servlet-mapping>
    </b><br><br>
    But still I am not able to access my servlet when i type
    http://localhost:8080/hello
    I get the error I mentioned above.

    Hi..Thanks for all those who have replied earlier. I feel I should add some more information.
    I dont know what PACKAGE NAME you are talking about
    I am pasting contents of my XML file located in :
    **apache-tomcat-5.5.26\webapps\ROOT\WEB-INF\web.xml**
    -->
    - <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>Welcome to Tomcat</display-name>
    <description>Welcome to Tomcat</description>
    - <!-- JSPC servlet mappings start
    -->
    - <servlet>
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>
    <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>
    - <servlet-mapping>
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>
    <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>
    - <!-- JSPC servlet mappings end
    -->
    </web-app>
    web.xml file located in
    apache-tomcat-5.5.26\webapps\servlets-examples\WEB-INF
    is given below:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements. See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version
    2.0
    (the "License"); you may not use this file except in compliance with
    the License. You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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>Servlet 2.4 Examples</display-name>
    <description>
    Servlet 2.4 Examples.
    </description>
    <!-- Define servlet-mapped and path-mapped example filters -->
    <filter>
    <filter-name>Servlet Mapped Filter</filter-name>
    <filter-class>filters.ExampleFilter</filter-class>
         <init-param>
         <param-name>attribute</param-name>
    <param-value>filters.ExampleFilter.SERVLET_MAPPED</param-value>
         </init-param>
    </filter>
    <filter>
    <filter-name>Path Mapped Filter</filter-name>
    <filter-class>filters.ExampleFilter</filter-class>
         <init-param>
         <param-name>attribute</param-name>
    <param-value>filters.ExampleFilter.PATH_MAPPED</param-value>
         </init-param>
    </filter>
    <filter>
    <filter-name>Request Dumper Filter</filter-name>
    <filter-class>filters.RequestDumperFilter</filter-class>
    </filter>
    <!-- Example filter to set character encoding on each request -->
    <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>EUC_JP</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>Compression Filter</filter-name>
    <filter-class>compressionFilters.CompressionFilter</filter-class>
    <init-param>
    <param-name>compressionThreshold</param-name>
    <param-value>10</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
    </init-param>
    </filter>
    <!-- Define filter mappings for the defined filters -->
    <filter-mapping>
    <filter-name>Servlet Mapped Filter</filter-name>
         <servlet-name>invoker</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Path Mapped Filter</filter-name>
         <url-pattern>/servlet/*</url-pattern>
    </filter-mapping>
    <!-- Example filter mapping to apply the "Set Character Encoding"
    filter
    to all requests processed by this web application -->
    <!--
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    -->
    <!--
    <filter-mapping>
    <filter-name>Compression Filter</filter-name>
    <url-pattern>/CompressionTest</url-pattern>
    </filter-mapping>
    -->
    <!--
    <filter-mapping>
    <filter-name>Request Dumper Filter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    -->
    <!-- Define example application events listeners -->
    <listener>
    <listener-class>listeners.ContextListener</listener-class>
    </listener>
    <listener>
    <listener-class>listeners.SessionListener</listener-class>
    </listener>
    <!-- Define servlets that are included in the example application
    -->
    <servlet>
    <servlet-name>CompressionFilterTestServlet</servlet-name>
    <servlet-class>compressionFilters.CompressionFilterTestServlet</servlet
    -class>
    </servlet>
    <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>hello</servlet-class>
    </servlet>
    </servlet>
    <servlet>
    <servlet-name>HelloWorldExample</servlet-name>
    <servlet-class>HelloWorldExample</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>RequestInfoExample</servlet-name>
    <servlet-class>RequestInfoExample</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>RequestHeaderExample</servlet-name>
    <servlet-class>RequestHeaderExample</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>RequestParamExample</servlet-name>
    <servlet-class>RequestParamExample</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>CookieExample</servlet-name>
    <servlet-class>CookieExample</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>SessionExample</servlet-name>
    <servlet-class>SessionExample</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>CompressionFilterTestServlet</servlet-name>
    <url-pattern>/CompressionTest</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>HelloWorldExample</servlet-name>
    <url-pattern>/servlet/HelloWorldExample</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>RequestInfoExample</servlet-name>
    <url-pattern>/servlet/RequestInfoExample/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>RequestHeaderExample</servlet-name>
    <url-pattern>/servlet/RequestHeaderExample</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>RequestParamExample</servlet-name>
    <url-pattern>/servlet/RequestParamExample</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>CookieExample</servlet-name>
    <url-pattern>/servlet/CookieExample</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>SessionExample</servlet-name>
    <url-pattern>/servlet/SessionExample</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/servlet/hello</url-pattern>
    </servlet-mapping>
    <security-constraint>
    <display-name>Example Security Constraint</display-name>
    <web-resource-collection>
    <web-resource-name>Protected Area</web-resource-name>
         <!-- Define the context-relative URL(s) to be protected -->
    <url-pattern>/jsp/security/protected/*</url-pattern>
         <!-- If you list http methods, only those methods are
    protected -->
         <http-method>DELETE</http-method>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
         <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
    <!-- Anyone with one of the listed roles may access this area
    -->
    <role-name>tomcat</role-name>
         <role-name>role1</role-name>
    </auth-constraint>
    </security-constraint>
    <!-- Default login configuration uses form-based authentication -->
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Example Form-Based Authentication Area</realm-name>
    <form-login-config>
    <form-login-page>/jsp/security/protected/login.jsp</form-login-page>
    <form-error-page>/jsp/security/protected/error.jsp</form-error-page>
    </form-login-config>
    </login-config>
    <!-- Security roles referenced by this web application -->
    <security-role>
    <role-name>role1</role-name>
    </security-role>
    <security-role>
    <role-name>tomcat</role-name>
    </security-role>
    <!-- Environment entry examples -->
    <!--env-entry>
    <env-entry-description>
    The maximum number of tax exemptions allowed to be set.
    </env-entry-description>
    <env-entry-name>maxExemptions</env-entry-name>
    <env-entry-value>15</env-entry-value>
    <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry-->
    <env-entry>
    <env-entry-name>minExemptions</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-type>
    <env-entry-value>1</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>foo/name1</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>value1</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>foo/bar/name2</env-entry-name>
    <env-entry-type>java.lang.Boolean</env-entry-type>
    <env-entry-value>true</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>name3</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-type>
    <env-entry-value>1</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>foo/name4</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-type>
    <env-entry-value>10</env-entry-value>
    </env-entry>
    </web-app>
    My program hello.java is given below
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class hello extends HttpServlet {
    public void doGet (HttpServletRequest req,
    HttpServletResponse res)
    throws ServletException, IOException
    PrintWriter out = res.getWriter();
    out.println("Hello, world!");
    out.close();
    }

  • The requested resource (/ShowParameters) is not available.

    hi
    hope someone can help me cause i'm looking for hours and cannot find my error :(
    I use a from.jsp with the following action:
    <form action="/ShowParameters" method="post">as soon as i click on the submit button i do get the following error message:
    The requested resource (/ShowParameters) is not available.I structured my tomcat webapp as followed:
    webapp called test:
    webapp\test\form.jsp
    webapp\test\WEB-INF\web.xml
    webapp\test\WEB-INF\classes\coreservlets\ShowParamaters.class
    my web.xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"  version="2.4">
         <servlet>
              <servlet-name>ShowParameters</servlet-name>
              <servlet-class>coreservlets.ShowParameters</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>ShowParameters</servlet-name>
              <url-pattern>/ShowParameters</url-pattern>
         </servlet-mapping>
    </web-app>and finally my ShowParameters.java
    package coreservlets;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    public class ShowParameters extends HttpServlet {
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
          throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        String title = "Reading All Request Parameters";
        out.println(ServletUtilities.headWithTitle(title) +
                    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                    "<H1 ALIGN=CENTER>" + title + "</H1>\n" +
                    "<TABLE BORDER=1 ALIGN=CENTER>\n" +
                    "<TR BGCOLOR=\"#FFAD00\">\n" +
                    "<TH>Parameter Name<TH>Parameter Value(s)");
        Enumeration paramNames = request.getParameterNames();
        while(paramNames.hasMoreElements()) {
          String paramName = (String)paramNames.nextElement();
          out.print("<TR><TD>" + paramName + "\n<TD>");
          String[] paramValues =
            request.getParameterValues(paramName);
          if (paramValues.length == 1) {
            String paramValue = paramValues[0];
            if (paramValue.length() == 0)
              out.println("<I>No Value</I>");
            else
              out.println(paramValue);
          } else {
            out.println("<UL>");
            for(int i=0; i<paramValues.length; i++) {
              out.println("<LI>" + paramValues);
    out.println("</UL>");
    out.println("</TABLE>\n</BODY></HTML>");
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    so that's my simple webapp but still i cannot find the error :(
    another questions: in general, would you suggest to use a controller.jsp instead of the servlet?

    hi
    1) i compiled the .java by using eclipse and did not get any error message
    2) my directory structure:
    webapp\test\form.jsp
    webapp\test\WEB-INF\web.xml
    webapp\test\WEB-INF\classes\coreservlets\ShowParamaters.class
    webapp\test\WEB-INF\classes\coreservlets\ServletUtitlities.class
    do i have to add the ServletUtilities.class also in the web.xml?
    thanks for helping cannot find any error :(

  • Http Status 404, The Requested resource is not available

    Dear Friends,
    I am getting error with my tomcat that " The Requested resource is not available"
    Kindly help me , What is the wrong with my code.
    I am using Eclipse 6.0.1, Tomcat 5.5.20, jdk 1.5.0, j2sdk 1.4.0
    My application is just to print user datas and my files are
    *1. login.jsp*
    <html>
    <head>
    <title>login Page </title>
    </head>
    <body>
    <form action="login" method="post">
    <table>
         <tr>
         <td>UserName</td><td><input type="text" name="username"/></td>
         </tr><tr>
         <td>Password</td><td><input type="password" name="password"/></td>     
         </tr>
         <tr><td><input type="submit" value="login"/>
         </tr>
    </table>
    </form>
    </body>
    </html>
    *2.web.xml*
    <web-app>
    <servlet>
         <servlet-name>login</servlet-name>
         <servlet-class>login</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>login</servlet-name>
         <url-pattern>/login</url-pattern>
    </servlet-mapping>
    </web-app>
    *3. login.java*
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class login extends HttpServlet
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              try
              PrintWriter out = res.getWriter();
              String name = req.getParameter("username");
              String password = req.getParameter("password");
              out.println(name+" servlet page");
              }catch(Exception e)
              e.printStackTrace();
    File Directory:
    Myapp
    ! !-->src
    ! ! !--> login.java
    ! !-->WebRoot
    ! !--> META-INF
    ! !--> WEB-INF
    ! !--> Classes
    ! !--> login.class
    ! !--> lib
    ! !--> web.xml
    -->login.jsp
    CATALINA_HOME C:\Program Files\Apache Software Foundation\Tomcat 5.5
    CLASSPATH C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar
    path C:\Program Files\Java\jdk1.5.0_05\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin;C:\j2sdk1.4.0\bin
    Please anyone give me the solution to solve my problem.
    Thank you

    Try moving your class file to a package
    <servlet-class>com.logon.login</servlet-class>
    ! !-->src
    ! ! !-->com
              ! !-->logon
                        ! !--> login.java

  • HTTP Status 404  error -- The requested resource  is not available.

    Hi ,
    i am trying to run a sample struts2 program using java1.5 , tomcat5.5 but getting the error ...
    * The requested resource (/Struts2Sample/) is not available.*
    i am listing my files below.. kindly help...
    web.xml -----------------
    <?xml version="1.0"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Struts2Sample</display-name>
    <filter>
    <filter-name>struts</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <servlet>
         <servlet-name>home</servlet-name>
         <jsp-file>HelloWorld.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
         <servlet-name>home</servlet-name>
         <url-pattern>/home</url-pattern>
    </servlet-mapping>
    </web-app>
    struts.xml ---------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <package name="example" extends="struts-default" namespace="/">
    <action name="HelloWorld" class="example.HelloWorld">
    <result>/HelloWorld.jsp</result>
    </action>
    </package>
    </struts>
    HelloWorld.jsp ----------------------
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head>
    <title>Struts 2 Hello World Application!</title>
    </head>
    <body>
    <h2><s:property value="message" /></h2>
    <p>Current date and time is: <b><s:property value="currentTime" /></b>
    </body>
    </html>
    ExampleSupport.java ---------------------------
    package example;
    import com.opensymphony.xwork2.ActionSupport;
    * Base Action class for the Tutorial package.
    public class ExampleSupport extends ActionSupport {
    HelloWorld.java --------------------
    package example;
    public class HelloWorld extends ExampleSupport {
    public String execute() throws Exception {
    setMessage(getText(MESSAGE));
    return SUCCESS;
    * Provide default valuie for Message property.
    public static final String MESSAGE = "HelloWorld.message";
    * Field for Message property.
    private String message;
    * Return Message property.
    * @return Message property
    public String getMessage() {
    return message;
    * Set Message property.
    * @param message Text to display on HelloWorld page.
    public void setMessage(String message) {
    this.message = message;
    My directory structure ....
    D:\tomcat5.5\webapps\Struts2Sample ---- this has my jsp file.
    D:\tomcat5.5\webapps\Struts2Sample\src\example ---- this has both java source files..
    D:\tomcat5.5\webapps\Struts2Sample\WEB-INF\classes\example ---- this has compiled class files
    D:\tomcat5.5\webapps\Struts2Sample\WEB-INF\classes ---- this has my struts.xml file
    D:\tomcat5.5\webapps\Struts2Sample\WEB-INF\lib ---- this has all my jars..
    D:\tomcat5.5\webapps\Struts2Sample\WEB-INF --- this has my web.xml file
    kindly let me know i am making mistakes if any...
    i am using url as : http://localhost:8080/Struts2Sample/
    Thanks,
    Nads

    Hi ,
    when iam trying to deploy struts 2 application iam getting 404 error. in tomcat 5.5.23
    if u got the solution pls help me
    regards
    srini

  • Receiving error - The requested resource is not available

    Hi,
    I am trying to deploy a new Project (WebApplication1) in NB5.0. I started with a very simple index.jsp and a small NewServlet. NB5.0 builds the project successfully. When I try to run, it opens a URL - http://localhost:8080/WebApplication1/WebApplication1, but then displays an error message - "The requested resource (/WebApplication1/WebApplication1) is not available." When I try to access - http://localhost:8080/WebApplication1/index.jsp, it loads the JSP successfully and also takes me to the servlet. Does anyone know why is the URL - http://localhost:8080/WebApplication1/WebApplication1 not pointing to index.jsp? I have index.jsp as welcome-page in web.xml.
    Thanks...

    In the Projects tab, right click WebApplication1 and then choose properties in the very end. In the Project Properties window, click the run in the left panel, check the context path in the right panel. Make sure it's /WebApplication1/WebApplication1 (default should be WebApplication1, I think).
    Then open web.xml to make sure the welcome page is added as index.jsp.

  • Web.xml deployment - The requested resource is not available

    I am trying to deploy part of my project and cannot get it to work.
    If I put this in:
    <url-pattern>/traveltimes.do</url-pattern>and go to http://localhost/testLINK/traveltimes.do it works fine.
    However when I put
    <url-pattern>/milwaukee/traveltimes.do</url-pattern>and go to
    http://localhost/testLINK/milwaukee/traveltimes.do
    I get this error:
    The requested resource (/milwaukee/milwaukee/traveltimes.jsp) is not available.I can't figure out why it is putting in that extra /milwaukee. Any ideas?
    John

    Well here is something really weird. If I change it to:
            <servlet-name>Milwaukee Travel Times</servlet-name>
            <url-pattern>/test/traveltimes.do</url-pattern>and go to http://localhost/testLINK/test/traveltimes.do
    I get
    /test/milwaukee/traveltimes.jspis not available. I have no idea where it is pulling that milwaukee from, and why it does so only when I have the extra level in the path.
    Any ideas on where I can go from here?
    John

  • HTTP 404 THE REQUESTED RESOURCE IS NOT AVAILABLE

    HELP ME PLEASE !!!!
    I HAVE AN APPLICATION THAT USES 3 PAGES: INDEX.HTML , MOTOR.JSP AND MOTOR2.JSP.
    THE LOGIC OF APPLICATION IS:
    FIRST STEP
    THE FIRST STEP IS SHOWING PAGE INDEX.HTML
    THERE IS THE FOLLOWING CODE IN THIS PAGE:
    <FORM ACTION="DIRECT">
    SECOND STEP
    DIRECT IS A SERVLET THAT HAVE THE FOLLOWING CODE:
    RequestDispatcher rd = req.getRequestDispatcher("Motor.jsp");
    rd.forward(req,res);
    THIRD STEP
    THE PAGE MOTOR.JSP REDIRECT TO A SERVLET ENGINE,
    AND SERVLET ENGINE REDIRECT TO A JSP MOTOR2.JSP
    USING THE COMMAND:
    RequestDispatcher rd = req.getRequestDispatcher("Motor2.jsp");
    rd.forward(req,res);
    IN THIS THIRD STEP THE PAGE IS ALWAYS REFRESHING
    TO ADD INFORMATION TO THE PAGE MOTOR2.JSP.
    SOMETIMES THE APPLICATION SHOWS ALL PAGES,
    BUT, SOMETIMES THE APPLICATION HAS AN ERROR:
    HTTP 404 - THE REQUESTED RESOURCE (/MOTOR2.JSP)
    IS NOT AVAILABLE
    I�M RUNNING THE APPLICATION IN TOMCAT 4.1.27
    IS ANYTHING WRONG WITH THE COMMANDS TO
    REDIRECT THE PAGES?
    PLEASE HELP ME
    THANKS VERY MUCH
    JANE PELLIM

    Hi,
    the refresh of the page is about 2 minutes, because some info
    about the process that is running in background
    is showing in the motor2 jsp.
    the redirects is necessary because in each page
    some processing is running in the servlets.
    The following is the web.xml configuration:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <context-param>
         <param-name>class_exec</param-name>
         <param-value>class_exec</param-value>
    </context-param>
    <context-param>
         <param-name>class_erro</param-name>
         <param-value>class_erro</param-value>
    </context-param>
    <context-param>
         <param-name>log_exec</param-name>
         <param-value>log_exec</param-value>
    </context-param>
    <context-param>
         <param-name>log_erro</param-name>
         <param-value>log_erro</param-value>
    </context-param>
    <context-param>
         <param-name>sleep_motor</param-name>
         <param-value>5</param-value>
    </context-param>
    <context-param>
         <param-name>bancos</param-name>
         <param-value>/motor.conf</param-value>
    </context-param>
    <servlet>
    <servlet-name>Engine</servlet-name>
    <servlet-class>com.motor.Engine</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Direct</servlet-name>
    <servlet-class>com.motor.Direct</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Monitor</servlet-name>
    <servlet-class>com.motor.Monitor</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Direct</servlet-name>
    <url-pattern>/Direct</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Engine</servlet-name>
    <url-pattern>/Engine</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Monitor</servlet-name>
    <url-pattern>/Monitor</url-pattern>
    </servlet-mapping>
    </web-app>
    Thanks
    Jane

Maybe you are looking for