求助...STRUTS..FORMBEAN填充不上去..总是空

dekkerhyp411 2006-04-19 09:35:52
----FORMBEAN类的属性

public class CommunityCatalogFormBean extends ActionForm {

// --------------------------------------------------------- Instance Variables

/** CatalogName property */
private String CatalogName;

/** CatalogType property */
private String CatalogType;

/** Remark property */
private String Remark;

/** Description property */
private String Description;

/** ParentID property */
private Integer ParentID;

/** SecurityID property */
private String SecurityID;

/** CatalogSort property */
private Integer CatalogSort;

/** CatalogID property */
private Integer CatalogID;
---STRUTS-CONFIG.XML配置
<form-beans >
<form-bean name="CommunityCatalogForm" type="com.bizengine.km.formbean.CommunityCatalogFormBean" />

</form-beans>


<global-exceptions />

<global-forwards />

<action-mappings >
<action
name="CommunityCatalogForm"
path="/community/doit"
scope="request"
type="com.bizengine.km.action.CommunityCatalogAction"
validate="false">

--ACTION部分调用
CommunityCatalogFormBean CatalogForm = (CommunityCatalogFormBean) form;
// TODO Auto-generated method stub
String dow=(String) request.getParameter("do");
System.out.println(dow);
if (dow.equals("add")){
System.out.println("**************");
CommunityCatalogDaoimpl dao1= new CommunityCatalogDaoimpl();
System.out.println("###CatalogForm"+CatalogForm.getCatalogID());

这里的ACTION部分打印就是NULL了..
...全文
153 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
dekkerhyp411 2006-04-19
  • 打赏
  • 举报
回复
有~~GET SET方法~~我只不过没帖全..名字改了..还有那儿有问题呢?HTML标签没有问题~~我一直都在用
sakas 2006-04-19
  • 打赏
  • 举报
回复
你的formbean中怎么没有get set 方法呢
li_d_s 2006-04-19
  • 打赏
  • 举报
回复
按照规范,第一个词首字母小写
yanransoft 2006-04-19
  • 打赏
  • 举报
回复
因为struts标签最终是要解析为标准Html标签的,所以用html标签也可以的。
yanransoft 2006-04-19
  • 打赏
  • 举报
回复
最好按照javaBean的规范:属性的第一个字母小写:CatalogName-〉catalogName
dreamover 2006-04-19
  • 打赏
  • 举报
回复
变量大小写问题,javabean有命名规范
bjxulei 2006-04-19
  • 打赏
  • 举报
回复
用html标签也行的。struts标签只是sun公司封装好的。
你把你的jsp中form中 action属性的地址改为:community/doit.do
dekkerhyp411 2006-04-19
  • 打赏
  • 举报
回复
........为什么...没人呢..
lip009 2006-04-19
  • 打赏
  • 举报
回复
你的JSP页面代码用的还是HTML表单标签元素,当然不行了,用了Struts框架,前台JSP页面必须使用Struts标签元素才能和后边的FormBean自动关联起来。
<form action="doit.do" method="post">
CatalogID标识 知识库目录:<html:text property="CatalogID"/><br>
CatalogName目录名称:<html:text property="CatalogName"/><br>
ParentID父级ID 0为顶级:<html:text property="ParentID"/><br>
SecurityID用于成员认证权限的关键字:<html:text property="SecurityID"/><br>
CatalogType目录类型 0为一般目录板块,1为社区专家目录板块 :<html:text property="CatalogType"/><br>
CatalogSort排序:<html:text property="CatalogSort"/><br>
Description 描述信息:<html:text property="Description"/><br>
Remark 属于 知识目录:<html:text property="Remark"/><br>
<html:submit>提交</html:submit>
<html:reset>重置</html:reset>
dekkerhyp411 2006-04-19
  • 打赏
  • 举报
回复
--页面的提交部分
<form action="doit.do" method="post">
CatalogID标识 知识库目录:<input type="text" name="CatalogID"><br>
CatalogName目录名称:<input type="text" name="CatalogName"><br>
ParentID父级ID 0为顶级:<input type="text" name="ParentID"><br>
SecurityID用于成员认证权限的关键字:<input type="text" name="SecurityID"><br>
CatalogType目录类型 0为一般目录板块,1为社区专家目录板块 :<input type="text" name="CatalogType"><br>
CatalogSort排序:<input type="text" name="CatalogSort"><br>
Description 描述信息:<input type="text" name="Description"><br>
Remark 属于 知识目录:<input type="text" name="Remark"><br>
<input type=submit value="提交">
<input type=reset value="重置">
dekkerhyp411 2006-04-19
  • 打赏
  • 举报
回复
谢谢~~我重写了一次可以了~~虽然查不出那个的原因..不过几位说的好像是对的谢谢几位..

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧