日期:2014-05-17  浏览次数:20667 次

struts2问题
context [/struts2_helloWord] startup failed due to previous errors  
tomcat 报错信息本人就考了一个

web.xml
<?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>Struts 2.0 Hello World</display-name>
  <filter>
  <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
  </filter>
  <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>
  <welcome-file-list>
  <welcome-file>index.html</welcome-file>
  </welcome-file-list>
</web-app>



struts.xml

<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
  <include file="struts-default.xml"/>
</struts>


index.html


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello World</title>
</head>
<body>
<h3>Hello World!</h3>
</body>
</html>


另外jar包
commons-logging-1.1.1
freemarker-2.3.19
ognl-3.0.5
struts2-core-2.3.3
xwork-core-2.3.3
其他的就没有了但是一直报这个错不知道为什么,本人刚接触struts2并不明白请各位指导的时候详细点谢谢了。。。另外网上搜到的也没看明白。。。

------解决方案--------------------
“context [/struts2_helloWord] startup failed due to previous errors ”

翻译:启动失败因为前面所列出的错误信息


大哥。。。好歹把前面的错误信息列出来啊。。。
------解决方案--------------------
你把控制台的错误都贴出来,好判断
------解决方案--------------------
1、你的struts2版本是struts2-core-2.3.3,控制器为什么不应该用org.apache.struts2.dispatcher.FilterDispatcher,这个过期的,应该用
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

2、struts.xml中,类似于如下配置
XML code

<struts>
<package name="struts2" extends="struts-default" >
<action name="login" class="action.LoginAction">
<result name="success">/result.jsp</result>
</action>
</package>
</struts>

------解决方案--------------------
跟环境变量没啥关系,话说楼主你为啥就是不愿意把启动的错误信息全部贴出来呢?让大家猜测是什么错误有啥好玩的。。。

------解决方案--------------------
探讨

path

C:\Java\jdk1.6.0_14\bin;C:\Java\jdk1.6.0_14\lib;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\CyberLink\Power2Go;C:\Program Files\Common Files\Thunder Network……

------解决方案--------------------
CMD窗口下,右键->标记,然后拖拽(看到白色底没有?)

区域拖拽好了后,就再按右键(白色底消失了吧?)

然后就可以 粘贴了。。。


话说。。。你大学翘课真的太多了。。。
------解决方案--------------------
哈哈 建议楼主看官网的教程。。。

struts的版本真是让人头大...早期版本和后期版本的配置有不小的差别
------解决方案--------------------
你缺少jar啊,java.lang.NoClassDef