|
网站首页
|
JAVA文章
|
AppServers
|
Web开发
|
应用开发
|
资源下载
|
想学好编程,学好外语很重要 [enadd 2006年12月25日]
设为首页
加入收藏
联系站长
您现在的位置:
编程笔记网
>>
JAVA文章
>>
开发工具
>>
Jbuilder
>> 文章正文
实战JBuilder8 + Struts,一个简单的例
【字体:
小
大
】
实战JBuilder8 + Struts,一个简单的例
作者:- 文章来源:- 点击数: 更新时间:2007-1-12
<bean:message key="loginOK.title"/>
</title>
</head>
<body bgcolor="#ffffff">
<h1>
<%=request.getSession().getAttribute("UserName")%>
<bean:message key="loginOK.message"/>
</h1>
</body>
</html>
4.10 修改struts-config.xml文件
在左侧的文件树中双击struts-config.xml文件,选中下方的Global Forwards项单击右侧的Add按钮,添加两项,如下图所示:
图20
4.11 修改web.xml文件
在左侧的文件树中双击web.xml文件,选中下方的Servlets->action项,单击右侧的Add按钮,添加一项application,如下图所示:
图21
图22
4.12 编写资源文件
选择File-》Save All保存所有文件。
选择Project-》Make Project “StrutsDemo.jpx” 编译项目。
编写一个名为ApplicationResources.properties的文本文件,保存至项目存放目录下的srcstrutsdemo里面,并将其添加到项目里面,右键单击此文件,选择Properties,按下图设置。
图23
文件内容如下:
login.title=Struts Demo
login.heading=<h1>Welcome to the StrutsDemo !</h1>
lgoin.message=Welcome to the StrutsDemo !
login.inputPassword=Please input Password :
login.inputName=Please input Username :
loginOK.title= User Login Successfull
loginOK.message=<h1>Login Successfull !</h1>
error.username.required=<h3><font color="red">UserName is Required !</font></h3>
error.password.required=<h3><font color="red">Password is Required !</font></h3>
error.username.wrong=<h3><font color="red">UserName is Wrong !</font></h3>
error.password.wrong=<h3><font color="red">Password is Wrong !</font></h3>
errors.footer=</ul><hr>
errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
三. 运行应用程序
1. 右键单击左边文件树中的login.jsp,选择WebRun Using Defaults即可。
2. 如果不输入name和password,单击submit的话,会看到错误提示,这是ActionForm生成的。
3. 如果输入了错误的name和password,单击submit的话,也会看到错误提示,这是由Action生成的,在本例中正确地name和password都是“liuxiaowei”,正确的话将会看到login successful页面,就是loginOK.jsp,用户名是通过session传递的。
原作者: liuxiaowei
原出处: csdn
上一页
[1]
[2]
[3]
文章录入:enadd 责任编辑:enadd
上一篇文章:
JBuilder8新特性
下一篇文章:
解析JBuilder数据库应用程序
【
发表评论
】【
加入收藏
】【
告诉好友
】【
打印此文
】【
关闭窗口
】
最新热点
最新推荐
相关文章
Borland公司推出“Jbuilder …
JBUILDER 5新增功能
JBuilder5+Weblogic 6.0安装…
JBuilder6:Borland方式的Jav…
JBuilder 4 Enterprise 开发…
Borland推出JBuilder新版本
经典Java开发工具介绍(4):…
JBuilder7+Weblogic7+mysql开…
如何让JBuilder运行在JDK1.4…
解析JBuilder数据库应用程序
网友评论:
(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
|
设为首页
|
加入收藏
|
联系站长
|
友情链接
|
版权申明
|
管理登录
|
Copyright ©2000 - 2005
Enadd
.com
备案序号:辽ICP备06005595号
站长:
enadd