struts2的问题
警告:Settings:Couldnotparsestruts.localesetting,substitutingdefaultVMlocale2010-4-3011:...
警告: Settings: Could not parse struts.locale setting, substituting default VM locale
2010-4-30 11:07:10 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
信息: Setting DefaultObjectTypeDeterminer as default ...
我自己刚开始自学struts2,我是照着书上写的,不过一运行就出现这个错误,然后就运行不了,为什么呀?哪位高的给 我看一下,谢谢!
我照书写的代码如下:
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"/>
<package name="default" extends="struts-default">
<action name="HelloWorld" class="com.web.struts.HelloWorld">
<result name="success">/HelloWorld.jsp</result>
</action>
</package>
</struts>
web.xml里的
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>
</web-app>
helloWorld.java里的
package com.web.struts;
import com.opensymphony.xwork2.Action;
public class HelloWorld implements Action {
private String message;
public String getMessage(){
return message;
}
public String execute() throws Exception {
message = "Hello World!";
return SUCCESS;
}
}
HelloWorld.jsp里的
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>欢迎页面</title></head>
<body>
<h2><s:property value="message"/></h2>
</body>
</html>
我就照书上写的这些,不知道哪里出了错就是不行,晕,哪位高手帮帮我这个新手!!!谢谢!! 展开
2010-4-30 11:07:10 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
信息: Setting DefaultObjectTypeDeterminer as default ...
我自己刚开始自学struts2,我是照着书上写的,不过一运行就出现这个错误,然后就运行不了,为什么呀?哪位高的给 我看一下,谢谢!
我照书写的代码如下:
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"/>
<package name="default" extends="struts-default">
<action name="HelloWorld" class="com.web.struts.HelloWorld">
<result name="success">/HelloWorld.jsp</result>
</action>
</package>
</struts>
web.xml里的
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>
</web-app>
helloWorld.java里的
package com.web.struts;
import com.opensymphony.xwork2.Action;
public class HelloWorld implements Action {
private String message;
public String getMessage(){
return message;
}
public String execute() throws Exception {
message = "Hello World!";
return SUCCESS;
}
}
HelloWorld.jsp里的
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>欢迎页面</title></head>
<body>
<h2><s:property value="message"/></h2>
</body>
</html>
我就照书上写的这些,不知道哪里出了错就是不行,晕,哪位高手帮帮我这个新手!!!谢谢!! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询