达则兼济天下,实则守恒如一  
不必羡慕海洋的浩瀚更不必勉强自己达到某种程度。即使你只是一滴水,只要你愿意,同样可以折射出太阳的光辉。重要的是,你要知道你自己
日历
<2025年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
统计
  • 随笔 - 1
  • 文章 - 2
  • 评论 - 3
  • 引用 - 0

导航

常用链接

留言簿(1)

随笔档案

文章档案

相册

搜索

  •  

最新评论

 
近日学netbeans6.1时发现一个关于visual web javaserver faces 的一个致命bug
描述如下:
        创建或重用一个起始页。添加一个“静态文本”组件,将它的 text 属性设置为 Hello,并设置它的 id 属性为 helloText
        添加一个“按钮”组件。双击“按钮”组件编辑它的 action 方法(button1_action)并用以下的代码替换方法体里的内容
        代码范例 1:button1_action 方法
          
this.helloText.setText("Good Bye");
return null;
显示如下错误:
找不到符号
符号: 变量 helloText

由于关于visual web javaserver faces 帮助内容不多,各种办法都想过了后来下载netbeans6.01又试了一下,才发现原委
在 netbeans6.01 环境下每在设计面板上添加一个组件,java代码编辑处便增加一条 对应的import 语句如下
1,在设计面板上什么组件也没有时,有以下import 语句:
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import javax.faces.FacesException;
2,在设计面板上添加组件后,有以下import 语句: import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.StaticText;
import javax.faces.FacesException;
多了两条 import 语句

代码在netbeans 6.01 环境下也能通过测试;

而在 netbeans 6.1
环境下
1,在设计面板上什么组件也没有时,有以下import 2条语句:
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import javax.faces.FacesException;
2,在设计面板上添加组件后,有以下import 语句:
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import javax.faces.FacesException;
还是两条 import 语句

即使把
全部import语句(如下)都加到netbeans 6.1 环境下
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.StaticText;
import javax.faces.FacesException;
亦显示以下语句为无用导入
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.StaticText; 且this关键字仍无法引用所建组建
我想这应是呢netbeans6.1 在visual web javaserver faces 方面的一个bug

王福华 2008-5-24
posted on 2008-05-24 23:24 yui 阅读(687) 评论(3)  编辑  收藏
评论:
  • # re: netbeans6.1 关于visual web javaserver faces 重大bug[未登录]  Aaron Posted @ 2008-07-02 10:25
    我也发现了类似的问题,不知道有没有找到合适的解决方法了呢?  回复  更多评论   

  • # re: netbeans6.1 关于visual web javaserver faces 重大bug  王福华 Posted @ 2008-07-02 11:52
    只是在6.1中每添加一个组件后要手动地在组件上右键
    选择“添加绑定属性”就可以了  回复  更多评论   

  • # re: netbeans6.1 关于visual web javaserver faces 重大bug  苏玉元 Posted @ 2010-03-01 20:23
    这不是个问题,以解决。
    添加绑定属性。  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © yui Powered by: 博客园 模板提供:沪江博客