jee第四周作业

hello1.java分析

@requestScope 声明该组件的作用范围为一次请求

该类作为管理bean类,定义了一个String变量name,并定义了那么的get、set方法,便于其他JSF页面调用,

在index.xtml页面,<h:inputText>元素中,调用hello类中的getname方法,返回值作为输入的初始值,

点击submit按钮后,调用hello类的setName方法,输入的值作为参数传入。

在response.xhtml页面中调用hello类中的get方法,将返回的值显示在页面上。

 

posted @ 2018-04-02 11:09  李昱  阅读(76)  评论(0编辑  收藏  举报