社区
Java EE
帖子详情
struts!!!options 问题!!!
zhaochunhui
2006-09-12 01:37:23
哪位大侠给个 options的例子~!和 bean的写法
...全文
150
10
打赏
收藏
struts!!!options 问题!!!
哪位大侠给个 options的例子~!和 bean的写法
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
10 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
lip009
2006-09-13
打赏
举报
回复
to: zhaochunhui(没有烟抽的日子) ( ) 信誉:100 Blog
我的Blog里有篇级联下拉列表的几种做法总结,AJAX的只有简单代码...你只需要把下拉改成Struts的就可以
zhaochunhui
2006-09-12
打赏
举报
回复
to lip009(深蓝忧郁) :
好使了,我其实想要做个 级联菜单的(省,市,县),用ajax实现下拉菜单中内容的变换,
你那有 struts+ajax的级联菜单吗
zhaochunhui
2006-09-12
打赏
举报
回复
lip009(深蓝忧郁) 谢谢
我试试
问题不段出现.唉
lip009
2006-09-12
打赏
举报
回复
集合放在哪是无所谓的
while(rs.next()){
org.apache.struts.util.LabelValueBean test=new org.apache.struts.util.LabelValueBean(rs.getString("province"),rs.getString("provinceID")));
mylist1.add(test);
}
然后把集合放到页面容器里,如request,session,pageContext等等
页面使用
<html:options collection="colorCollection" property="value" labelProperty="label"/>
zhaochunhui
2006-09-12
打赏
举报
回复
你的不是把 集合 放在 pageContext中了吗
如果 要是从bean中读取 应该怎么做?
我的代码 有什么问题?
lip009
2006-09-12
打赏
举报
回复
看看上面的用法撒
zhaochunhui
2006-09-12
打赏
举报
回复
up
zhaochunhui
2006-09-12
打赏
举报
回复
我的问题是这样的~!
显示页面
------------------------------------------
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ 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" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<jsp:useBean scope="page" id="Test" class="com.hdtq.main.Testbean"/>
<jsp:getProperty name="Test" property="search"/>
....
<html:select property="username">
<html:option value="">--</html:option>
<html:options collection="Test" property="provinceid" labelProperty="provincename"/>
</html:select>
.....
---------------------------------------
Testbean.java
--------------------------------------
public class Testbean {
public Collection getSearch(){
DBCPool dbc= new DBCPool();
Connection conn=dbc.getConnection("school_1");
Statement stmt=null;
Collection mylist1=new ArrayList();
if(conn!=null){
try{
stmt=conn.createStatement();
}catch(SQLException err){
System.out.println(err.getMessage());
}
}
ResultSet rs=null;
try{
rs=stmt.executeQuery("select provinceID,province from province");
Test test;
while(rs.next()){
test=new Test();
test.setProvinceid(rs.getString("provinceID"));
test.setProvincename(rs.getString("province"));
mylist1.add(test);
}
}catch(Exception er){
System.out.println(er.getMessage());
}
try{
stmt.close();
conn.close();
}catch(Exception err1){
System.out.println(err1.getMessage());
}
return mylist1;
}
}
---------------------------------
报的是这样的错误...........
Cannot create iterator for com.hdtq.main.Testbean......
过来帮帮我吧
lip009
2006-09-12
打赏
举报
回复
<%
Vector colorCollection=new Vector();
colorCollection.add(new org.apache.struts.util.LabelValueBean("显示内容1","值1"));
colorCollection.add(new org.apache.struts.util.LabelValueBean("显示内容2","值2"));
pageContext.setAttribute("colorCollection",colorCollection);
%>
<html:select property="colors" multiple="true">
<html:options collection="colorCollection" property="value" labelProperty="label"/>
</html:select>
碧海情天-赵亮
2006-09-12
打赏
举报
回复
进来,页面一片空白,一看问题,原来也是一片空白,让人无言以对
不能白进,帮顶一下
Struts
2-注解第一个例子
Struts
2-注解第一个例子
Jakarta_
Struts
_for_Dummies.pdf
Part III: Expanding Your Development
Options
Chapter 8: Exceptions to the Rule Chapter 9: Getting Friendly with Plug-ins Chapter 10: Getting a Helping Hand with Tag Libraries Chapter 11: Working ...
孙维琴
struts
1中掌握html标签小程序
孙维琴
struts
1中掌握html标签小程序。有几个比较典型的标签: <html:
options
> <html:link> <html:rewrite> <jsp:useBean> 等的用法
cj_easyui_combobox_
struts
_velocity.docx
完全结合最新的SSH框架,jquery jeasyui velocity等特性,进行生意下拉列表的实现,避免了复杂性的SELECT
OPTIONS
等代码编写
S2-061:一些
struts
标记,超出范围的属性将调用SetDynamicAttribute()函数,这将导致执行ONGL表达式
S2-061 (CVE-2020-17530) some
struts
tag , ...default
struts
tag list, these dynamic-attribute
options
are true. 默认的
struts
tag列表,这些dynamic-attribute选项都为True when code review,check the li
Java EE
67,515
社区成员
225,878
社区内容
发帖
与我相关
我的任务
Java EE
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
复制链接
扫一扫
分享
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章