jsp 中:
<bean : write 就可以在画面显示了
<bean : write 就可以在画面显示了
解决方案 »
- 调用数据库中数据以XML形式显示,然后由Ajax异步显示在页面上
- 向j2ee过来人请教!
- 谁有sql2005 jar包下载 传我一个嘛!!!
- 在struts2的框架中,jsp页面的include标签不能包含一个action页面
- 使用Struts开发强制修改用户密码问题,急急急!!请教各位的帮助!
- TOMCAT加载WEB.XML的问题,在线等,急!
- 关于EJB维护ORACLE字段自动增量的效率问题-讨论
- 用java weblogic.ejbc编译时为何总报找不到.xml文件
- HTTP Status 404 - There is no Action mapped for action name login. 帮我看一下,哪里有问题。
- 使用https除了多增加证书的费用外,服务器比http需多增加多少成本?
- 熟悉j_security_check的进来
- 用HIBERNATE,如果一个表很多人删除、查找、更新怎么办,本来我就用锁定,但是好象不太好,用HIBERNATE该怎么做?
public class PersonBean { private String userName = null; public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
} /**
* This is a stub method that would be used for the Model to save
* the information submitted to a persistent store. In this sample
* application it is not used.
*/
public void saveToPersistentStore() { /*
* This is a stub method that might be used to save the person's
* name to a persistent store(i.e. database) if this were a real application.
*
* The actual business operations that would exist within a Model
* component would depend upon the requirements of the application.
*/
}
}
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true">
<head>
<title><bean:message key="hello.jsp.title"/></title>
<html:base/>
</head>
<body bgcolor="white"><p> <h2><bean:message key="hello.jsp.page.heading"/></h2><p> <html:errors/><p> <logic:present name="personbean" scope="request">
<h2>
<bean:message key="hello.jsp.page.hello"/>
<bean:write name="personbean" property="userName" />!<p>
</h2>
</logic:present> <html:form action="/HelloWorld.do" focus="userName" > <bean:message key="hello.jsp.prompt.person"/>
<html:text property="userName" size="16" maxlength="16"/><br> <html:submit property="submit" value="Submit"/>
<html:reset/> </html:form><br> <html:img page="/struts-power.gif" alt="Powered by Struts"/> </body>
</html:html>