java - http status 404 The requested resource (/Crime/) is not available -
this question has answer here:
i'm using struts framework , problem occurred when deploy project.... why error occurred @ deploy time???
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"> <welcome-file-list> <welcome-file>userlogin.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>f1</filter-name> <filter-class>org.apache.struts2.dispatcher.filterdispatcher</filter-class> </filter> <filter-mapping> <filter-name>f1</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.apache.struts2.tiles.strutstileslistener</listener-class> </listener> </web-app>
tiles.xml
<?xml version="1.0" encoding="utf-8" ?> <!doctype tiles-definitions public "-//apache software foundation//dtd tiles configuration 2.0//en" "http://tiles.apache.org/dtds/tiles-config_2_0.dtd"> <tiles-definitions> <definition name="common" template="/firstlayout.jsp"> <put-attribute name="header" value="/header.jsp"/> <put-attribute name="body" value="/footer.jsp"/> </definition> <definition name="validuser" extends="common"> <put-attribute name="title" value="login user"/> <put-attribute name="contents" value="/userlogin.jsp"/> </definition> <definition name="invaliduser" extends="common"> <put-attribute name="tilte" value="login error" /> <put-attribute name="contents" value="/relogin.jsp" /> </definition> </tiles-definitions>
struts.xml
<?xml version="1.0" encoding="utf-8" ?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.1//en" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="p1" extends="tiles-default"> <action name="signin" class="action.loginaction "> <result name="success" type="tiles">validuser</result> <result name="failure" type="tiles">invaliduser</result> </action> </package> </struts>
this error occurring while add struts jar file in project... earlier running without error..is there problem strut file. using myeclipse 8.5 , tomcat server 6.0. .
the thread old, post solution anyway, more people learning how write web application using apache struts frame work, undoubtedly encounter same problem.
the problem eclipse not copy root folder apache tomcat eclipse work place. go apache-tomcat folder, copy root folder in webapps folder.
paste eclipse: your_workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
tmp0 current server.
also, make sure add struts .jar files.
that's folks
tl
Comments
Post a Comment