struts 及使用标签的一些步骤
来源:互联网 发布:碧桂园同心共享 知乎 编辑:程序博客网 时间:2024/05/17 08:54
1配置struts
copy lib web.xml struts-config.xml
配制Action (注意path=/login 有/无.do 但是在其他jsp向转发则需写login.do 不是/login.do)
<action path="/login" type="login.LoginAction" name="loginForm"
scope="request">
<forward name="success" path="/loginSuccess.jsp"></forward>
<forward name="error" path="/loginError.jsp"></forward>
</action>
struts标签配制
1 struts-config中加入
<message-resources parameter="ApplicationResources" />
2
复制ApplicationResources.properties 到src目录下
3
jsp 中加
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
/////////////logic 中的id 变量是把其存为一个变量,默认是page 范围内的变量
/////////////
<logic:notEmpty name="list">
<logic:iterate id="index" name="list">
用户名
<bean:write name="index" property="username" />
<br>年龄
<bean:write name="index" property="age" />
<br>所属组名:
<bean:write name="index" property="g.name" /><br><p><p>
</logic:iterate>
<bean:write name="index" />
</logic:notEmpty>
struts 文件上传的一些注意:
<form action="uploadAction.do" method ="post"enctype="multipart/form-data">
文件名:
<input type="text" name="filename"><br>
file: <input type="file" name="file"><br>
<input type="submit" value="submit"><br>
</form>
file: <input type="file" name="file"><br> 这一行的name="file" 的"file"中不能出现空格,file在struts Form类中必须具有同样的名字,且为org.apache.struts.upload.FormFile;类
method ="post"enctype="multipart/form-data" 要同时存在,不能只具其一
一些关于上传的配置可以在struts-config中配制,例如文件最大大小等:如下
<controller maxFileSize="10M" ></controller>
- struts 及使用标签的一些步骤
- Struts html标签的使用及说明
- Struts标签的一些用法
- Struts 1 学习笔记-2-1(Struts标签的使用步骤)
- struts标签的使用
- struts标签的使用
- struts 标签的使用
- Struts的FormBean及常见错误和标签的使用
- Struts的FormBean及常见错误和标签的使用
- struts-struts标签的使用(一)
- Struts 常用标签的使用
- Struts使用标签的问题
- struts数据标签的使用
- struts数据标签的使用
- struts的if标签使用
- 关于struts标签库的一些积累
- 自定义标签的使用步骤
- struts标签一些
- 解决输入文件中(如txt)回车换行的方法
- Windows操作快捷键(she's question)
- 也谈人生的意义
- C#里面比较时间大小三种方法
- 微软kill进程的命令
- struts 及使用标签的一些步骤
- 在ubuntu8.04中安装OpenOffice3
- squid权威书籍
- 无库(exe)->SLL(.lib)->DLL(.dll)->COM(.dll)->OLE Control eXtention(.ocx)->ActiveX Control(.ocx)
- XP系统自动关机命令
- RecordStore实现访问计数器
- 与技术无关
- 电脑前面板后面板话筒都有声音
- 在删除数据库记录前弹出一个对话框,和确认按钮和取消按钮