ADF_General JSF系列1_创建一个简单的JSF Application

简介: 2015-02-17 Creatd By BaoXinjian 一、摘要 本文介绍如何创建一个简单的Application Step 1: Create a New Application and Project Step 2: Create a JSF Page Step 3: Des...

2015-02-17 Creatd By BaoXinjian

一、摘要


本文介绍如何创建一个简单的Application

Step 1: Create a New Application and Project

Step 2: Create a JSF Page

Step 3: Design the UI

Step 4: Modify the Behavior Through Code

 

1: Create a New Application and Project


Step1. 创建Custom Application

Step2.  查看错所创建的Application

 

2: Create a JSF Page


Step1. 创建测试页面

Step2. 简单测试页面如下

 

3: Design the UI


Step1. 导入HTML和JSF控件

Step2.  最后组成如下控件

 

4: Modify the Behavior Through Code


Step1.  建立Managed Bean

Step2.  添加Button方法

Step3.  查看所创建的Java Managed Bean

Step4. Managed Bean中的代码

package project.backing;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlForm;
import javax.faces.component.html.HtmlInputText;
import javax.faces.component.html.HtmlOutputText;

@ManagedBean(name="backing_start")
@RequestScoped
public class StartInfo {
    private HtmlOutputText outputText1;
    private HtmlCommandButton commandButton1;
    private HtmlInputText inputText1;
    private HtmlForm form1;

    public StartInfo() {
    }

    public void setOutputText1(HtmlOutputText outputText1) {
        this.outputText1 = outputText1;
    }

    public HtmlOutputText getOutputText1() {
        return outputText1;
    }

    public void setCommandButton1(HtmlCommandButton commandButton1) {
        this.commandButton1 = commandButton1;
    }

    public HtmlCommandButton getCommandButton1() {
        return commandButton1;
    }

    public void setInputText1(HtmlInputText inputText1) {
        this.inputText1 = inputText1;
    }

    public HtmlInputText getInputText1() {
        return inputText1;
    }

    public void setForm1(HtmlForm form1) {
        this.form1 = form1;
    }

    public HtmlForm getForm1() {
        return form1;
    }

    public Object commandButton1_action() {
        // Add event code here...
        outputText1.setValue("Hello "+inputText1.getValue());
        return null;
    }
}

Step5.  页面测试结果,当点击按钮式,将Input的值数据到显示栏位

 

Thanks and Regards

ERP技术讨论群: 288307890
技术交流,技术讨论,欢迎加入
Technology Blog Created By Oracle ERP - 鲍新建
相关文章
|
开发框架 安全
06dwr - web.xml配置(多个 dwr.xml 配置和 J2EE 角色定义)
06dwr - web.xml配置(多个 dwr.xml 配置和 J2EE 角色定义)
46 0
|
Java Android开发 应用服务中间件
|
Java Spring API
How to configure spring boot through annotations in order to have something similar to <jsp-config> in web.xml?
JSP file not rendering in Spring Boot web application You will need not one but two dependencies (jasper and jstl) in your pom.
1046 0
|
Web App开发 Java Apache
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
执行Maven Install打包的时候,出现以下错误信息: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.
1505 0
|
Web App开发 Java 测试技术
ADF_Starting系列9_使用EJB/JPA/JSF通过ADF构建Web应用程序之测试J2EE Container
2013-05-01 Created By BaoXinjian 一、摘要 在本教程中,您将使用甲骨文的JDeveloper 11 g版本11.1.2.0.0来构建一个web应用程序。 建立数据模型,您可以使用EJB图,EJB 3.0和Java Persistence API(JPA)。
1417 0
|
Java 测试技术
ADF_General JSF系列3_将JSP页面绑定到一个Managed Bean
2015-02-17 Created By BaoXinjian 一、摘要 本文介绍如何再JSF Application中创建和使用Bean Step 1: Create a New Application and Project Step 2: Create a JSF Page S...
1295 0
ADF_General JSF系列2_创建JSF类型的页面向导
2015-02-17 Created By BaoXinjian 一、摘要 本文介绍在JSF创建页面向导 Step 1: Create a New Application and Project Step 2: Create JSF Page Navigation Step 3: Cre...
1260 0
|
关系型数据库
Error_OAF_the descriptive flexfield with application name payables and name is not frozen
2014-06-17 BaoXinjian 1. Issue and Eroor Error: The descriptive flexfield with application name payable(SQLAP) and name BXJ_DESC_FLEX is not frozen 2.
611 0