| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 700 人关注过本帖
标题:关于mutlibox与LabelValueBean的问题
取消只看楼主 加入收藏
cheesetree
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-4-18
收藏
 问题点数:0 回复次数:0 
关于mutlibox与LabelValueBean的问题
想做一个 复选框的提交页面
我用的是struts1.x框架
form文件
private LabelValueBean[] mstra;//setter getter

jsp文件
<%

UserUtil mm = new UserUtil();
LabelValueBean[] ms =  mm.getmstr();
session.setAttribute( "ms", ms);
%>

<td>
     <logic:iterate id = "mstra"  name= "ms">   
        <html:multibox name = "mstra" property="value">
            <bean:write name = "mstra" property="value"/>
        </html:multibox >
       <bean:write name = "mstra" property="label"/>
    </logic:iterate >
</td>


getmstr()方法是UserUtil 中的提取数据库数据的
public LabelValueBean[] getmstr() throws Exception{
     LabelValueBean[] mstra1 = new LabelValueBean[20];
     DBConnect conn = new DBConnect();
     String key = null;
     String value = null;
     String mslist = "select MID,MName from ADMIN_MODULE";
     conn.getConn();
     ResultSet rs1 = conn.getrs(mslist);
     int i =0;
     try{
        while(rs1.next()){
            key = Integer.toString(rs1.getInt("MID"));
            value = (String)rs1.getString("MName");
            mstra1[i++] = new LabelValueBean(key,value);
        }
    }catch(SQLException e) {
        System.out.print("Exception in getmid() error!");
    }finally {
      conn.close();
    }
        return mstra1;
    }

执行页面时提示
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 16 in the jsp file: /sysmanage/NewRole.jsp
The method getmstr() is undefined for the type UserUtil
13: UserUtil mm = new UserUtil();
14: //mMap = mm.getModulemap();
15: //session.setAttribute( "mMap", mMap);
16: LabelValueBean[] ms =  mm.getmstr();
17: session.setAttribute( "ms", ms);
18: %>
19: <head>
Stacktrace:
    at org.apache.(DefaultErrorHandler.java:93)
    at org.apache.(ErrorDispatcher.java:330)
    at org.apache.(JDTCompiler.java:435)
    at org.apache.(Compiler.java:298)
    at org.apache.(Compiler.java:277)
    at org.apache.(Compiler.java:265)
    at org.apache.jasper.(JspCompilationContext.java:564)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:595)


请问大家这是怎么回事??
搜索更多相关主题的帖子: mutlibox 
2008-05-21 00:02
快速回复:关于mutlibox与LabelValueBean的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033030 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved