Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have tried to create an application in struts2.I have created an action class 'crawlAction' in CrawlPackage.Index page is running fine but While executing "localhost:8080/Project/getQuery.action" ,I get the following error:-

HTTP Status 404 - Not Found
Type- Status report
message- Not Found
description- The requested resource is not available.


web.xml:-

XML
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">

<session-config>
   <session-timeout>
       30
   </session-timeout>
</session-config>
<welcome-file-list>
   <welcome-file>index.jsp</welcome-file>
</welcome-file-list>



<filter>
   <filter-name>struts2</filter-name>

  <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>


</web-app>




struts.xml:-


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>
<!-- Configuration for the default package. -->
<package name="default"  extends="struts-default">
  <action name="getQuery" class="CrawlPackage.crawlAction">
      <result name="ShowLinks"  >result.jsp</result>
      <result name="error">error.jsp</result>

  </action>

</package>
</struts>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900