java - Struts2 isn't loading my webapp...404 error? -


i complete newbie struts2 , unable run involving on tomcat in either eclipse/browser. tomcat working fine when mapping servlets/jsp in web.xml file, when trying switch struts2 can't work. when try run on server isn't going index jsp...just loading 404 error. followed online tutorial when couldn't app class running , tutorial can't run either. here jar files have added tomcat lib/build path jars -

asm-5.0.2.jar              asm-commons-5.0.2.jar        asm-tree-5.0.2.jar          commons-fileupload-1.3.1.jar       commons-io-2.2.jar      commons-lang3-3.2.jar    commons-logging-1.1.3.jar    commons-logging-api-1.1.jar    freemarker-2.3.19.jar    javassist-3.11.0.ga.jar    ognl-3.0.6.jar     struts-core-1.3.10.jar     struts2-dojo-plugin-2.3.20.jar     xwork-core-2.3.20.jar     

filter added web.xml -

<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> 

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> <constant name="struts.devmode" value="true" /> <package name="helloworld" extends="struts-default">    <action name="hello"          class="com.struts2.files.helloworldaction"          method="execute">         <result name="success">/helloworld.jsp</result>   </action> </package> </struts> 

any ideas why getting 404 when trying run app?

i guess, you've added wrong struts-core-1.3.10.jar classpath. belongs struts 1.x. need include latest struts2-core-2.x.x.jar struts 2 framework.

a typical struts 2 application has following jars under web-inf/lib directory.

commons-fileupload-1.2.1 commons-io-1.3.2 commons-logging-1.1 freemarker-2.3.13 junit-3.8.1 ognl-2.6.11 xwork-2.1.2 struts2-core-2.1.6 struts2-convention-plugin-2.1.6 (if using annotations) 

try downloading latests jars struts.apache.org.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -