title: Error 404--Not Found,The server has not found anything matching the Request-URI
body: <p>this my web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     
           xmlns="http://java.sun.com/xml/ns/javaee" 
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"    
           version="3.0"&gt;
  &lt;display-name&gt;struts2app&lt;/display-name&gt;
   &lt;welcome-file-list&gt;
  &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
  &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
  &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
  &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;filter&gt;
  &lt;filter-name&gt;struts2&lt;/filter-name&gt;
  &lt;filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;struts2&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>this is my struts.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
       "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
   &lt;struts&gt;
  
  
      &lt;package name="struts2app" extends="struts-default" namespace="/"&gt;
          &lt;action name="insert"  class="info.trisan.Insert" method="execute"&gt;
              &lt;result name="fail"&gt;/insert.jsp&lt;/result&gt;
              &lt;result name="success"&gt;/success.jsp&lt;/result&gt;
          &lt;/action&gt;
  
      &lt;/package&gt;
   &lt;/struts&gt;
  </code></pre>
  
  <p>this is my jsp</p>
  
  <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
   &lt;html&gt;
   &lt;head&gt;&lt;/head&gt;
   &lt;body&gt;
   &lt;form action="insert"&gt;
  &lt;label&gt;Serial no&lt;/label&gt;
  &lt;input type="text" name="sno"/&gt;&lt;br/&gt;
  &lt;label&gt;Ser Name&lt;/label&gt;
  &lt;input type="text"  name="sname"/&gt;&lt;br/&gt;
  &lt;label&gt;Ser country&lt;/label&gt;
  &lt;input type="text" name="scountry"/&gt;&lt;br/&gt;
  
  &lt;input type="submit" value="click me"/&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>this is my action class</p>
  
  <pre><code> package info.trisan;
   import java.sql.*;
  
   public class Insert {
  String sno;
  String sname;
  String scountry;
  
  public String getSno() {
      return sno;
  }
  
  public void setSno(String sno) {
      this.sno = sno;
  }
  
  public String getSname() {
      return sname;
  }
  
  public void setSname(String sname) {
      this.sname = sname;
  }
  
  
  public String getScountry() {
      return scountry;
  }
  
  public void setScountry(String scountry) {
      this.scountry = scountry;
  }
  
  public String execute(){
          String output="fail";
  
          int sn=Integer.parseInt(sno);
      try{
          Class.forName("com.mysql.jdbc.Driver");
          Connection    con=DriverManager.getConnection("url", "abc", "abc");
          PreparedStatement pst=con.prepareStatement("insert into details values(?,?,?");
          int n=pst.executeUpdate();
          if(n==sn){
              output="success";
          }           
      }
      catch(SQLException sqe){
          System.out.println(sqe.toString());
      }
      catch(ClassNotFoundException sqe){
          System.out.println(sqe.toString());
              }       
          return output;
  }
  
   }
  </code></pre>
  
  <p>here iam trying to run with this code in welogic12</p>
  
  <p>servser address/struts2app/
  then the jsp page is opened,once clicked on submit it is showing following error</p>
  
  <p>Error 404--Not Found
  From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
  10.4.5 404 Not Found</p>
  
  <p>The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.</p>
  
  <p>If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.</p>
  
  <p>I tryed with StrutsPrepareAndExecuteFilter also,no result
  I can not understand,Any help ?</p>