为什么struts2 加了DEVMODE就报错
这些是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="default" namespace="/" extends="struts-default">
<action name="hello_struts">
<result>
/Hello.jsp
</result>
</action>
</package>
<!-- Add packages here -->
</struts>
这是hello.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>HelloStruts2</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
Hello Struts2<br>
</body>
</html>
------解决方案--------------------Java code
struts.devMode=true
------解决方案--------------------
我跟楼主是同一个问题,不过问题早在1个月之前解决掉了。我说句,你看的是尚学堂马士兵老师讲的Struts2吧??他没有说这个所导致的一些问题。就是Tomcat的安装路径里面不能包含空格。比如N多人都喜欢放在C:\Program Files里。或者Tomcat6.0中间多了个空格。变成了Tomcat 6.0。所以就报错了。。。好了可以结贴了。顺便给我来个10分!!!哈哈