pluto.ctl

In the previous Developing Portlets Using JSP & Servlet we clarified you how can we use a Portlets, JSPs & Servlets for creating an MVC architectual application that’s easy to maintain, easy to debug and easy to develop.

在先前的使用JSP和Servlet开发Portlet中,我们阐明了如何使用Portlet,JSP和Servlet创建易于维护,易于调试和易于开发的MVC体系结构应用程序。

But why we would waste a lot of time in developing such that orchestration while others were already did. JSF framework are MVC compliant framework, as its components contained the concept of Separation of concern (SoC).

但是为什么我们要花很多时间来开发这种编排,而其他编排却已经做了呢。 JSF框架是MVC兼容框架 ,因为其组件包含关注分离(SoC)的概念。

Facelets technology are used for handling the view purposes, its backing bean act as controllers and you can use its Expression Language for glue your views with the proposed models.

Facelets技术用于处理视图,它的支持bean充当控制器,您可以使用其Expression Language将您的视图与建议的模型粘合在一起。

It’s elegant framework as you can use it within your Portlets, that will make them JSF-based Portlets. For this purpose, Java Community (JC) has proposed two different JSR (Java Specification Request) to simplify integrating your Portals with the well-know JSF framework.

这是一个优雅的框架,您可以在Portlet中使用它,从而使它们成为基于JSF的Portlet 。 为此,Java Community(JC)提出了两种不同的JSR(Java Specification Request),以简化将Portal与知名的JSF框架集成的过程。

JSR-301 is a Portlet container specification that defines the required behavior of a JSR-168,286 (Portlet Specification) that proxies for JSF artifacts. Meanwhile, JSR-329 is for Portlet container 2.0 bridge for JavaServer Faces (JSF) 1.2 Specification that defines the required behavior for allowing the JSF Application/View to be accessed as a Java Portlet.

JSR-301是Portlet容器规范,它定义了代理JSF工件的JSR-168,286(Portlet规范)的必需行为。 同时, JSR-329用于JavaServer Faces(JSF)1.2规范的Portlet容器2.0桥,该规范定义了允许JSF Application / View作为Java Portlet访问的必需行为。

Until writing these lines, no specification has been released for JavaServer Faces 2.0, though the implementation is already provided. This tutorial will provide you detailed information that help you getting all these technologies integrated each together as they work efficiently.

在编写这些行之前,尽管已经提供了实现,但尚未发布JavaServer Faces 2.0的规范。 本教程将为您提供详细的信息,以帮助您将所有这些技术有效地结合在一起。

  • Any Portal (Portlet container 2.0 compliance) Like Apache Pluto.任何门户网站(符合Portlet容器2.0),例如Apache Pluto。
  • JSF 2.0 (Either by using MyFaces 2.0 or by using Reference Implementation JSF Mojarra 2.0).JSF 2.0(使用MyFaces 2.0或使用参考实现JSF Mojarra 2.0)。
  • Any Portlet Bridge that’s compliant with JSR-329 like MyFaces 2.0 Portlet Bridge.任何与JSR-329兼容的Portlet Bridge,例如MyFaces 2.0 Portlet Bridge。

Employee registration operation is the process for which the integration will be achieved, as no need for using of Standard Java Portlet, Java Server Pages and Servlet for doing so.

员工注册操作是实现集成的过程,因为不需要使用Standard Java Portlet,Java Server Pages和Servlet。

数据库设计和所需模型 (Database Design & Required Model)

For explaining purposes, it’s good for you to know what’s the form of the database table that we would use for retaining the registered employees.

为了说明目的,对您而言,我们将用来保留已注册员工的数据库表的形式对您有好处。

Employee.sql

Employee.sql

CREATE TABLE `employee` (`EMP_ID` int(11) NOT NULL AUTO_INCREMENT,`EMP_NAME` varchar(45) DEFAULT NULL,`EMP_JOB` varchar(45) DEFAULT NULL,`EMP_SALARY` int(11) DEFAULT NULL,PRIMARY KEY (`EMP_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

Employee entity (Model) that would be created according for employee Table figured above will be:

将根据上图的员工表创建的Employee实体(模型)为:

package com.journaldev.data;public class Employee {private String id;private String name;private String job;private String salary;public String getId() {return id;}public void setId(String id) {this.id = id;}public String getSalary() {return salary;}public void setSalary(String salary) {this.salary = salary;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getJob() {return job;}public void setJob(String job) {this.job = job;}}

设计图 (Design View)

The design view for the operation of employee registration is just as JSF framework has done, the process of bridging has eliminated the need of walking through Portlet container accompanies.

员工注册操作的设计视图就像JSF框架所做的那样,桥接过程消除了遍历Portlet容器伴随的需求。

The figured design depicts you for how the flow of execution have to proceed, it’s just like any JSF application you may be made in the past.

上图的设计描述了执行流程如何进行,就像您过去制作的任何JSF应用程序一样。

注册员工XHTML (Register Employee XHTML)

JSF 2.0 has used a Facelets as view technology instead of JSP that’s supported by JSF 1.x. Registration employee page would look like below:

JSF 2.0使用Facelets作为视图技术,而不是JSF 1.x支持的JSP。 注册员工页面如下所示:

register.xhtml

register.xhtml

<html xmlns="https://www.w3.org/1999/xhtml"xmlns:ui="https://java.sun.com/jsf/facelets"xmlns:h="https://java.sun.com/jsf/html"xmlns:f="https://java.sun.com/jsf/core"><h:head><title>Register Employee</title></h:head><h:body><h:messages showSummary="true" errorStyle="color:red;" infoStyle="color:green;"/><h:form prependId="false"><h:panelGrid columns="2" style="width:100%"><h:outputLabel for="id" value="Identity"></h:outputLabel> <h:inputText id="id" value="#{registerEmployeeManagedBean.employee.id}" required="true" requiredMessage="ID is mandatory"><f:validateRegex pattern="[0-9]*"></f:validateRegex></h:inputText>          <h:outputLabel for="name" value="Name"></h:outputLabel> <h:inputText id="name" value="#{registerEmployeeManagedBean.employee.name}"></h:inputText><h:outputLabel for="job" value="Job"></h:outputLabel> <h:inputText id="job" value="#{registerEmployeeManagedBean.employee.job}"></h:inputText><h:outputLabel for="salary" value="Salary"></h:outputLabel> <h:inputText id="salary" value="#{registerEmployeeManagedBean.employee.salary}" requiredMessage="Salary is mandatory"><f:validateRegex pattern="[0-9]*"></f:validateRegex><f:validateLength minimum="2" maximum="4"></f:validateLength></h:inputText>                                                                                               </h:panelGrid><h:commandButton value="Register" actionListener="#{registerEmployeeManagedBean.registerListener}" style=""></h:commandButton></h:form></h:body>
</html>

Here’s detailed explanation for the code listed above:

这是上面列出的代码的详细说明:

  • Registration page has used the XHML format. Facelets has supported the XHML as a format of its view.注册页面已使用XHML格式。 Facelets支持XHML作为其视图格式。
  • The user need to fill in all required information fields like identity and salary, in case you’ve missed them out, an error message would be flagged. These error messages are shown by the JSF framework itself as we’ve used a <f:validateRegex/> and required attributes.用户需要填写所有必填信息字段,例如身份和薪水,以防万一您错过了它们,将标记一条错误消息。 这些错误消息由JSF框架本身显示,因为我们使用了<f:validateRegex />和必需的属性。
  • In case you’ve entered a Not Number value within identity or salary fields, a JSF error message would be displayed tell you that you’re entering an invalid value.如果您在身份或薪水字段中输入了“非数字”值,则会显示一条JSF错误消息,提示您输入的是无效值。
  • All fields are associated with their respective attributes against employee property that’s already defined in the RegisterEmployeeManagedBean. As so, no submitted values are extracted from the request object.所有字段都与各自的属性相关联,该属性与RegisterEmployeeManagedBean中已定义的雇员属性有关。 因此,不会从请求对象中提取任何提交的值。

注册员工托管的Bean (Register Employee Managed Bean)

As JSF promised, everything will get retained into your bean, no need for orchestrating a lot of components that you’ve used before for extracting the user submitted parameters as no need for handling much issues you may do in case you’ve decided to not use a JSF framework like messages, locales and so on.

正如JSF所承诺的那样,所有内容都将保留在您的bean中,无需编排以前提取用户提交的参数时使用过的许多组件,因为不需要处理很多事情,以防万一您决定不这样做。使用诸如消息,语言环境等的JSF框架。

package com.journaldev.beans;import java.io.IOException;
import java.sql.SQLException;import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;import org.apache.log4j.Logger;import com.journaldev.dao.EmployeeDAO;
import com.journaldev.data.Employee;@ManagedBean
@SessionScoped
public class RegisterEmployeeManagedBean {private static Logger logger = Logger.getLogger(RegisterEmployeeManagedBean.class);private Employee employee = new Employee();public Employee getEmployee() {return employee;}public void setEmployee(Employee employee) {this.employee = employee;}public void registerListener(ActionEvent event){try {// Register Employeethis.employee = EmployeeDAO.getInstance().createEmployee(employee);logger.debug("Employee Has Registered");FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,"Employee has regisered successfully !",""));// Reset employeethis.employee = new Employee();} catch (IllegalAccessException | ClassNotFoundException | SQLException | IOException e) {logger.debug("Registration Process Has Failed",e);FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,"Unforunately!, employee hasn't registered cause to : "+e,""));}}
}

Here’s detailed explanation for the bean code figured out:

这里是对得出的Bean代码的详细说明:

  • A plain old Java object (POJO) employee is used for binding purpose. In JSF, each component may be associated with a value provided by the Managed Bean. Once the form has been submitted, JSF framework has been started and the submitted values are transferred magically into the binded bean.一个普通的旧Java对象(PO​​JO)雇员用于绑定。 在JSF中,每个组件都可以与受管Bean提供的值相关联。 提交表单后,便会启动JSF框架,并将提交的值神奇地传输到绑定的bean中。
  • As we’ve JSF 2.0, no need for faces configuration file (faces-config.xml), and so, we used the newly added annotations for declaring the managed bean and its scope.在JSF 2.0中,不需要人脸配置文件(faces-config.xml),因此,我们使用了新添加的注释来声明托管bean及其作用域。
  • Remember as no JSR proposed for JSF 2.0, but it’s already implemented and you may get used in a lot of Portlet container that’s supported JSR-286.请记住,因为没有为JSF 2.0提出JSR提议,但是它已经实现,并且您可能会在许多受JSR-286支持的Portlet容器中使用它。
  • You may notice using of EmployeeDAO and ConnectionUtility, if you remember what we have discussed at the Developing Portlets Using JSP & Servlet where in, your good design lead you for easy-to-maintain code, easy-to-debug and easy-to-develop (i.e. Separation of concern). Look at now, you have the ability to re-use the code you made. Really !! nothing touched with these two utilities.您可能会注意到使用EmployeeDAO和ConnectionUtility,如果您还记得我们在“ 使用JSP和Servlet开发Portlet”中讨论的内容,那么良好的设计将引导您轻松维护代码,易于调试和易于实现。发展(即关注分离)。 现在看,您可以重用您编写的代码。 真的! 这两个实用程序没有任何关系。
  • All of these classes that are relevant for the database communication have been got isolated to be used later on by any presentation layer. So, you either use the JSF, default JSP/Servlet, normal Java Desktop application or you may wrap them up to be SOAP-based service or Restful-based service.与数据库通信相关的所有这些类均已隔离,以后可用于任何表示层。 因此,您可以使用JSF,默认的JSP / Servlet,普通的Java Desktop应用程序,也可以将它们包装为基于SOAP的服务或基于Restful的服务。
  • The user will get a confirmation messages either the registration process has been finished successfully or it’s being failed.注册过程已成功完成或失败,用户将收到一条确认消息。
  • In case the registration process has failed, the confirmation message would show you the main cause for this failure.如果注册过程失败,则确认消息将向您显示该失败的主要原因。

JSF-Portlet桥依赖性 (JSF-Portlet Bridge Dependencies)

As we’ve mentioned before in that the Portlet Bridge is just a specification, so a lot of vendors have implemented it. We will use the MyFaces 3.0.0-alpha version that’s provided for Portlet Container 2.0. Two dependencies listed below must be added into your Maven build file to get Portlet Bridge implementation involved and used.

正如我们之前提到的,Portlet Bridge只是一个规范,因此许多供应商已经实现了它。 我们将使用为Portlet Container 2.0提供的MyFaces 3.0.0-alpha版本。 必须将以下列出的两个依赖项添加到您的Maven构建文件中,才能涉及和使用Portlet Bridge实施。

MyFaces-PortletBridge

MyFaces-PortletBridge

<dependency><groupId>org.apache.myfaces.portlet-bridge</groupId><artifactId>portlet-bridge-api</artifactId><version>3.0.0-alpha</version>
</dependency>
<dependency><groupId>org.apache.myfaces.portlet-bridge</groupId><artifactId>portlet-bridge-impl</artifactId><version>3.0.0-alpha</version>
</dependency>

JSF实施和部署描述符 (JSF Implementation & Deployment Descriptor)

JSF is a standard specification, that’s mean different vendors have already provided their own implementation. However, this part of tutorial is very important one as we would show you how can use two different implementations for getting JSF implementation used and what’s the impact of that usage on the deployment descriptor file.

JSF是一个标准规范,这意味着不同的供应商已经提供了自己的实现。 但是,本教程的这一部分非常重要,因为我们将向您展示如何使用两种不同的实现来使用JSF实现,以及该用法对部署描述符文件的影响。

Let’s firstly choose the most standard JSF implementation, it’s for sure a JSF Mojarra 2.0. You must add these below dependencies into you own maven for make use of JSF Mojarra.

首先让我们选择最标准的JSF实现,可以肯定的是JSF Mojarra 2.0 。 您必须将以下这些依赖项添加到您自己的Maven中,才能使用JSF Mojarra。

JSF - Reference Implementation - Mojaraa Dependencies

JSF - Reference Implementation - Mojaraa Dependencies

<!-- Faces Implementation -->
<dependency><groupId>com.sun.faces</groupId><artifactId>jsf-impl</artifactId><version>2.1.15</version>
</dependency>
<!-- Faces Library -->
<dependency><groupId>com.sun.faces</groupId><artifactId>jsf-api</artifactId><version>2.1.15</version>
</dependency>

And so, your web.xml file should be like this:

因此,您的web.xml文件应如下所示:

web.xml

web.xml

<!DOCTYPE web-app PUBLIC"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN""https://java.sun.com/dtd/web-app_2_3.dtd" ><web-app><display-name>Employee Registration</display-name><servlet><servlet-name>Faces Servlet</servlet-name><servlet-class>javax.faces.webapp.FacesServlet</servlet-class><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>Faces Servlet</servlet-name><url-pattern>*.xhtml</url-pattern></servlet-mapping><context-param><description>State saving method: 'client' or 'server' (=default). SeeJSF Specification 2.5.2</description><param-name>javax.faces.STATE_SAVING_METHOD</param-name><param-value>server</param-value></context-param><listener><listener-class>com.sun.faces.config.ConfigureListener</listener-class></listener>
</web-app>

But let’s see now what are these dependencies required for making MyFaces 2.0 get used instead of Reference Implementation JSF Mojarra 2.0.

但是,现在让我们看看使用MyFaces 2.0代替Reference Implementation JSF Mojarra 2.0需要哪些依赖关系。

JSF - MyFaces Dependencies

JSF - MyFaces Dependencies

<dependency><groupId>org.apache.myfaces.core</groupId><artifactId>myfaces-api</artifactId><version>2.1.15</version>
</dependency>
<dependency><groupId>org.apache.myfaces.core</groupId><artifactId>myfaces-impl</artifactId><version>2.1.15</version>
</dependency>

And so, you must have the same entries listed above in the web.xml but with major change, in that the listener mentioned must be removed.

因此,您必须在web.xml中具有上面列出的相同条目,但要进行重大更改,因为必须删除提到的侦听器。

web.xml

web.xml

<!DOCTYPE web-app PUBLIC"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN""https://java.sun.com/dtd/web-app_2_3.dtd" ><web-app><display-name>Employee Registration</display-name><servlet><servlet-name>Faces Servlet</servlet-name><servlet-class>javax.faces.webapp.FacesServlet</servlet-class><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>Faces Servlet</servlet-name><url-pattern>*.xhtml</url-pattern></servlet-mapping><context-param><description>State saving method: 'client' or 'server' (=default). SeeJSF Specification 2.5.2</description><param-name>javax.faces.STATE_SAVING_METHOD</param-name><param-value>server</param-value></context-param>
</web-app>

完整的Maven构建文件 (Full Maven Build File)

Find below full maven build file that will be used for implementing a JSF/Mojarra Portlet.

在下面找到完整的maven构建文件,该文件将用于实现JSF / Mojarra Portlet。

pom.xml

pom.xml

<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.journaldev</groupId><artifactId>EmployeeRegistration-JSFBridge</artifactId><packaging>war</packaging><version>0.0.1-SNAPSHOT</version><name>EmployeeRegistration-JSFBridge</name><url>https://maven.apache.org</url><properties><deployFolder>D:/Apache Pluto/pluto-2.0.3/webapps</deployFolder></properties><dependencies><!-- Java Portlet Specification V2.0 --><dependency><groupId>org.apache.portals</groupId><artifactId>portlet-api_2.0_spec</artifactId><version>1.0</version><scope>provided</scope></dependency><dependency><groupId>log4j</groupId><artifactId>log4j</artifactId><version>1.2.17</version></dependency><dependency><groupId>org.apache.pluto</groupId><artifactId>pluto-taglib</artifactId><version>1.1.7</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.32</version></dependency><dependency><groupId>org.apache.myfaces.portlet-bridge</groupId><artifactId>portlet-bridge-api</artifactId><version>3.0.0-alpha</version></dependency><dependency><groupId>org.apache.myfaces.portlet-bridge</groupId><artifactId>portlet-bridge-impl</artifactId><version>3.0.0-alpha</version></dependency><!-- Faces Implementation --><dependency><groupId>com.sun.faces</groupId><artifactId>jsf-impl</artifactId><version>2.1.15</version></dependency><!-- Faces Library --><dependency><groupId>com.sun.faces</groupId><artifactId>jsf-api</artifactId><version>2.1.15</version></dependency></dependencies><build><finalName>${project.artifactId}</finalName><plugins><!-- bind 'pluto2:assemble' goal to 'process-resources' lifecycle --><!-- This plugin will read your portlet.xml and web.xml and injects requiredlines --><plugin><groupId>org.apache.portals.pluto</groupId><artifactId>maven-pluto-plugin</artifactId><version>2.1.0-M3</version><executions><execution><phase>generate-resources</phase><goals><goal>assemble</goal></goals></execution></executions></plugin><!-- configure maven-war-plugin to use updated web.xml --><!-- This plugin will make sure your WAR will contain the updated web.xml --><plugin><artifactId>maven-war-plugin</artifactId><version>2.1.1</version><configuration><webXml>${project.build.directory}/pluto-resources/web.xml</webXml></configuration></plugin><plugin><artifactId>maven-antrun-plugin</artifactId><executions><execution><id>copy</id><phase>integration-test</phase><configuration><tasks><copy file="target/${project.artifactId}.war" tofile="${deployFolder}/${project.artifactId}.war" /></tasks></configuration><goals><goal>run</goal></goals></execution><execution><id>delete</id><phase>clean</phase><configuration><tasks><delete file="${deployFolder}/${project.artifactId}.war" /><delete dir="${deployFolder}/${project.artifactId}" /></tasks><detail>true</detail></configuration><goals><goal>run</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.7</source><target>1.7</target></configuration></plugin></plugins></build>
</project>

员工DAO和ConnectionUtility (EmployeeDAO & ConnectionUtility)

Now, it’s time to make a fast look at the EmployeeDAO and ConnectionUtility classes. These classes are used to handle all of these issues that are relevant for Database connectivity.

现在,是时候快速查看EmployeeDAO和ConnectionUtility类了。 这些类用于处理所有与数据库连接有关的问题。

package com.journaldev.dao;import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;import com.journaldev.dao.utility.ConnectionUtility;
import com.journaldev.data.Employee;public class EmployeeDAO {public static EmployeeDAO employeeDAO = null;private EmployeeDAO(){}public static EmployeeDAO getInstance(){synchronized(EmployeeDAO.class){if(employeeDAO == null){employeeDAO = new EmployeeDAO();}}return employeeDAO;}public Employee createEmployee(Employee employee) throws SQLException, IllegalAccessException, IOException, ClassNotFoundException{// Get connection instanceConnection connection = ConnectionUtility.getInstance().getConnection();// Create Prepared StatementPreparedStatement query = connection.prepareStatement("INSERT INTO EMPLOYEE VALUES (?,?,?,?)");// Set variablesquery.setInt(1, Integer.parseInt(employee.getId()));query.setString(2, employee.getName());query.setString(3, employee.getJob());query.setInt(4, Integer.parseInt(employee.getSalary()));try {// Executequery.execute();// Return employee instancereturn employee;}catch(Exception e){// Close statementquery.close();// Close connectionconnection.close();// Throw another exception for notifying the Servletthrow new SQLException(e);}}public boolean deleteEmployee(Employee employee){return false;}public boolean updateEmployee(Employee employee, int employeeId){return false;}
}
package com.journaldev.dao.utility;import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;public class ConnectionUtility {private static ConnectionUtility connectionUtiliy = null;private Connection connection = null;private ConnectionUtility() {}public static ConnectionUtility getInstance() throws IOException, IllegalAccessException, SQLException, ClassNotFoundException{// Synchronized against connectionUtility instancesynchronized(ConnectionUtility.class){// Check whether the connectionUtility is null or notif(connectionUtiliy == null){// Create a properties instanceProperties properties = new Properties();// Load properties from classpathproperties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("connection.properties"));// Set connection with connectionUtilityconnectionUtiliy = new ConnectionUtility();// Load driver classClass.forName("com.mysql.jdbc.Driver");// Create connectionconnectionUtiliy.setConnection(DriverManager.getConnection("jdbc:mysql://localhost:3306/journaldev", properties));}return connectionUtiliy;}}public Connection getConnection() throws ClassNotFoundException, SQLException, IOException {if(connection.isClosed()){// Create a properties instanceProperties properties = new Properties();// Load properties from classpathproperties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("connection.properties"));// Load driver classClass.forName("com.mysql.jdbc.Driver");// Create connectionconnectionUtiliy.setConnection(DriverManager.getConnection("jdbc:mysql://localhost:3306/journaldev", properties));}return connection;}public void setConnection(Connection connection) {this.connection = connection;}}

注册员工演示 (Register Employee Demo)

The demonstration starts by deploying your developed WAR into your Apache Pluto Portlet container 2.0. Log in into your Apache Pluto and navigating into JournalDev page that’s already implemented in the previous introduced tutorials.

演示首先将开发的WAR部署到Apache Pluto Portlet容器2.0中。 登录到您的Apache Pluto,然后导航到先前介绍的教程中已实现的JournalDev页面。

Let’s see how JSF served you in case you’ve entered an invalid values, for that just put a character values inside both of id and salary fields.

让我们看看在输入无效值的情况下JSF是如何为您服务的,因为您只需将一个字符值放在id和salary字段中即可。

But what’s happened if we’ve tried to register already registered employees.

但是,如果我们尝试注册已经注册的员工,会发生什么情况。

What’s happened if we register a new employee.

如果我们注册新员工会发生什么。

摘要 (Summary)

This tutorial is a unique one as it’s summarized the all required information for getting used a JSF-based application onto Portlet container. The all required configuration, dependencies, accompanies classes and much more, they are listed completely here. Contribute us by commenting below and find downloaded source code.

本教程是一个独特的教程,它总结了将基于JSF的应用程序用于Portlet容器所需的所有信息。 所有必需的配置,依赖项,类以及更多内容,都在此处完整列出。 通过在下面评论来贡献我们,并找到下载的源代码。

Download Portal Portlet Bridge JSF Project下载Portal Portlet Bridge JSF项目

翻译自: https://www.journaldev.com/5033/apache-pluto-portlet-bridge-jsf-2-example-tutorial

pluto.ctl

pluto.ctl_Apache Pluto,Portlet Bridge和JSF 2.0集成示例教程相关推荐

  1. JSF Spring Hibernate集成示例教程

    JSF Spring Hibernate集成示例教程 欢迎使用JSF Spring Hibernate Integration示例教程.在上一篇教程中,我们了解了如何将JSF和Spring框架集成在一 ...

  2. jsf集成spring_JSF Spring Hibernate集成示例教程

    jsf集成spring Welcome to JSF Spring Hibernate Integration example tutorial. In our last tutorial, we s ...

  3. adalm pluto_Apache Pluto Portlet&Struts 2集成示例教程

    adalm pluto In earlier tutorials, we've developed different types of Portlet. Portlets are developed ...

  4. adalm pluto_Apache Pluto和PHP集成示例教程

    adalm pluto Creating of PHP Portlet isn't an easy mission as no standard specification created for. ...

  5. web.xml.jsf_面向初学者的JSF 2.0教程

    web.xml.jsf 1.什么是JSF? JSF是Java Server Faces的首字母缩写. 它是一种服务器端处理技术,它允许将服务器端代码嵌入到网页中. 由于可以将服务器端处理和渲染代码嵌入 ...

  6. 面向初学者的JSF 2.0教程

    1.什么是JSF? JSF是Java Server Faces的首字母缩写. 它是一种服务器端处理技术,它允许将服务器端代码嵌入到网页中. 由于可以将服务器端处理和呈现代码嵌入网页本身,因此使项目的整 ...

  7. adalm pluto_将Apache Pluto与Lucene搜索引擎示例教程集成

    adalm pluto Knowledge information retrieval isn't a luxury requirement that your application may or ...

  8. junit 经典示例_JUnit 4,JWebUnit,Arquillian和JSF单元示例教程

    junit 经典示例 Along side of development lifecycle, most of us looking for a way to be sure that the uni ...

  9. portlet示例_Java Portlet示例教程

    portlet示例 In the presented introduction about Apache Pluto, we've mainly discussed the most simple P ...

最新文章

  1. 基于OpenCV实战:绘制图像轮廓(附代码)
  2. server sql 数据总行数_sql统计行数的语句
  3. 关于写文章的一点经验
  4. jQuery动态设置样式List item
  5. Python学习之路和隐藏特征
  6. (4)vue.js 基础语法
  7. TensorFlow 教程 --教程--2.8循环神经网络
  8. 【Codeforces Round #508 (Div. 2)】Slime【简单贪心】
  9. 学完 Fluent 官方基础教程,你离一名合格Fluent 流体工程师还有多远?
  10. android定位和地图开发实例
  11. 最新GEP分销系统网站源码官方
  12. CV 经典主干网络 (Backbone) 系列: 开篇
  13. python类的实例化和继承
  14. uiview 渐变_UIView的背景渐变
  15. 基于java web的学生考勤带请假管理系统-计算机毕业设计
  16. python 全栈开发,Day21(抽象类,接口类,多态,鸭子类型)
  17. can‘t load package: cannot find module providing package github.com/hyperledger/fabric/core/chaincod
  18. 强化学习之策略迭代求解冰冻湖
  19. sql server 2012创建学生数据库
  20. vue项目使用阿里无痕验证

热门文章

  1. 对于C# 中事件的参数(object sender, EventArgs e)
  2. [转帖]SQL SERVER 2005 安全设置
  3. [转载] python+selenium自动化软件测试(第3章):unittes
  4. [转载] python缩进报错_python缩进报错
  5. [转载] python中sort,sorted,reverse,reversed的区别
  6. 二、将mysql用作一个简单的计算器
  7. C++杂记之this指针
  8. 使用HttpURLConnection+AsyncTask访问webservice接口(返回json字符串)
  9. Requested registry access is not allowed 解决办法
  10. sftp访问_实时数据处理探索:接收、处理、访问