<s:property value="message"/>在JSP页面里面没显示值
ACTION的文件packageorg.sunxin.struts2.ch02.action;importcom.opensymphony.xwork2.Action;p...
ACTION 的文件
package org.sunxin.struts2.ch02.action;
import com.opensymphony.xwork2.Action;
public class HelloWorldAction implements Action {
private String message;
public String getMessage() {
return message;
}
public String execute() throws Exception {
message = "Hello World!";
return SUCCESS;
}
}
ACTION 的配置
<package name="HelloWorld" extends="struts-default">
<action name="HelloWorld" class="org.sunxin.struts2.ch02.action.HelloWorldAction">
<result name="success">/HelloWorld.jsp</result>
</action>
实在不知道哪里出错了
JSP页面:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>欢迎页面</title></head>
<body>
<h2><s:property value="message"/>223</h2>
</body>
</html>
textfiled" defined in tag library imported with prefix "s" 这个不行
EL 表达式也不行 没有值 TOMCAT启动的时候又报错 The web application [/Demo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@174859]) and a value of type [com.opensymphony.xwork2.inject.InternalContext[]] (value [[Lcom.opensymphony.xwork2.inject.InternalContext;@bbf6ed]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
是不是这个问题? 展开
package org.sunxin.struts2.ch02.action;
import com.opensymphony.xwork2.Action;
public class HelloWorldAction implements Action {
private String message;
public String getMessage() {
return message;
}
public String execute() throws Exception {
message = "Hello World!";
return SUCCESS;
}
}
ACTION 的配置
<package name="HelloWorld" extends="struts-default">
<action name="HelloWorld" class="org.sunxin.struts2.ch02.action.HelloWorldAction">
<result name="success">/HelloWorld.jsp</result>
</action>
实在不知道哪里出错了
JSP页面:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>欢迎页面</title></head>
<body>
<h2><s:property value="message"/>223</h2>
</body>
</html>
textfiled" defined in tag library imported with prefix "s" 这个不行
EL 表达式也不行 没有值 TOMCAT启动的时候又报错 The web application [/Demo] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@174859]) and a value of type [com.opensymphony.xwork2.inject.InternalContext[]] (value [[Lcom.opensymphony.xwork2.inject.InternalContext;@bbf6ed]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
是不是这个问题? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询