jsf

Validate field and throw exception in JSF, but attach error message to another field?

落爺英雄遲暮 提交于 2020-03-03 05:55:49
问题 I have some fields on my page which I want cross-validated. But I don't want error from this validation to be displayed in <h:message> for this fields. If I add validator to any of the fields, and validator throws exception, error is displayed in <h:message> for this field. On the other hand I HAVE TO throw exception if I want to suppress page from submitting. Just displaying some error message is not enough. So I created some hidden field on the form, and attached validator there. This

java技术路线

痴心易碎 提交于 2020-02-29 05:57:22
在技术方面无论我们怎么学习,总感觉需要提升自已,却又不知道从哪里着手,同时也不知道自己处于哪个水平。这时候就需要有清晰的指示图来指引我们,这样我们能清楚的知道我们在哪方面不足,以及自己大概处于哪个阶段和水平。 Java程序员 高级特性 反射、泛型、注释符、自动装箱和拆箱、枚举类、可变 参数、可变返回类型、增强循环、静态导入 核心编程 IO、多线程、实体类、 集合类、正则表达式、 XML和属性文件 网路编程 Socket/TCP/UDP、NIO、RMI、CORBA Java语法基础 类、抽象类、接口、最终类、静态类、匿名类、内部类、异常类、编码规范 Java开发环境 JDK、JVM、Eclipse、Linux Java核心编程技术 Java,设计而又非常精巧的语言。学习Java,须从Java开发环境开始,到Java语法,再到Java的核心API。 1.Java开发入门:Java开发环境的安装与使用,包括JDK命令、EclipseIDE、Linux下Java程序的开发和部署等。 2.Java语法基础:基于JDK和Eclipse环境,进行Java核心功能开发,掌握Java面向对象的语法构成,包括类、抽象类、接口、最终类、静态类、匿名类、内部类、异常的编写。 3.Java核心API:基于JDK提供的类库,掌握三大核心功能: A.Java核心编程:包括Java编程的两大核心功能—

select all in datatable jsf primefaces

帅比萌擦擦* 提交于 2020-02-28 15:05:34
问题 Im trying to create a select all button or check box that when clicked all the selectbooleanCheck boxes will be checked. is there no straight forward easy way.ive started creating the selectcheckbox that will when changed selectAll. thanks <p:dataTable value="#{illRequestModel.list}" var="illRequestRecord" width="100%" styleClass="request-table" rows="10" paginator="true" id="requestGrid" currentPageReportTemplate="Viewing Page {currentPage}" paginatorTemplate="{CurrentPageReport} {PageLinks}

action和actionListener之间的区别

我的未来我决定 提交于 2020-02-27 01:43:48
action 和 actionListener 什么区别,什么时候应该使用 action 和 actionListener ? #1楼 在调用Action并确定下一页的位置之前,将首先触发ActionListener并提供修改响应的选项。 如果您在同一页面上有多个按钮,这些按钮应该移至相同的位置,但执行的操作略有不同,则可以为每个按钮使用相同的Action,但使用不同的ActionListener处理稍微不同的功能。 这是描述关系的链接: http://www.java-samples.com/showtutorial.php?tutorialid=605 #2楼 actionListener 如果您想 在 执行实际业务操作 之前 有一个钩子 , 请使用 actionListener ,例如将其记录和/或设置其他属性(通过 <f:setPropertyActionListener> ),和/或访问调用了动作(可通过 ActionEvent 参数获得)。 因此,纯粹是为了在调用实际业务操作之前进行准备。 默认情况下, actionListener 方法具有以下签名: import javax.faces.event.ActionEvent; // ... public void actionListener(ActionEvent event) { // ... }

基于Web的Design Patterns应用程序

╄→гoц情女王★ 提交于 2020-02-27 00:56:58
已关闭 。 这个问题是基于意见的。 它当前不接受答案。 了解更多 。 想改善这个问题吗? 更新问题,以便通过 编辑此帖子 以事实和引用的形式回答。 去年 关闭。 我正在设计一个简单的基于Web的应用程序。 我是这个基于Web的领域的新手,我需要您提供有关设计模式的建议,例如如何在Servlet之间分配职责,创建新Servlet的条件等。 实际上,我主页上的实体很少,而与每个实体相对应,我们几乎没有添加,编辑和删除等选项。 早些时候,我为每个选项使用一个Servlet,例如Servlet1用于添加实体1,Servlet2用于编辑实体1,依此类推,这样我们最终拥有大量的Servlet。 现在,我们正在更改设计。 我的问题是,如何正确选择如何选择servlet的责任。 每个实体是否应该有一个Servlet,它将处理所有选项并将请求转发到服务层。 还是应该为整个页面设置一个servlet,它将处理整个页面请求,然后将其转发到相应的服务层? 同样,请求对象是否应该转发到服务层。 #1楼 我使用了 struts 框架,发现它相当容易学习。 使用struts框架时,网站的每个页面都会包含以下项目。 1)每次刷新HTML页面时,都会调用使用的操作。 该操作应在首次加载页面时填充表单中的数据,并处理Web UI与业务层之间的交互。 如果使用jsp页面修改可变的Java对象

如何选择合适的bean范围?

匆匆过客 提交于 2020-02-26 13:45:29
我注意到有不同的bean作用域,例如: @RequestScoped @ViewScoped @FlowScoped @SessionScoped @ApplicationScoped 每个的目的是什么? 如何为我的bean选择合适的范围? #1楼 从JSF 2.3开始,已弃用 javax.faces.bean 包中定义的所有bean作用域,以使作用域与CDI对齐。 此外,它们仅在您的bean使用 @ManagedBean 注释时才适用。 如果您使用的JSF版本低于2.3,请参考最后的遗留答案。 从JSF 2.3开始,这里是可以在JSF Backing Bean上使用的范围: 1. @javax.enterprise.context.ApplicationScoped :应用程序作用域在Web应用程序的整个持续时间内一直存在。 该范围在所有请求和所有会话之间共享。 当您拥有整个应用程序的数据时,这很有用。 2. @javax.enterprise.context.SessionScoped :会话范围从建立会话的时间一直持续到会话终止为止。 会话上下文在同一HTTP会话中发生的所有请求之间共享。 当您不想为特定会话保存特定客户端的数据时,此功能很有用。 3. @javax.enterprise.context.ConversationScoped

Editable Datatable RowKey Null

旧时模样 提交于 2020-02-24 11:22:06
问题 I have an editable Primefaces Datatable configured to call an onCellEdit() method when a cell is edited. Everything works great except that CellEditEvent.rowKey is always null in spite of setting it explicitly to a valid value in the Datatable declaration with 'rowKey='. The Primefaces Datatable documentation leads me to believe that I need the rowKey to get the contents of the row containing the cell being edited. I need the entire row's contents so I can compare the displayed data with the

Wicket vs GWT - Advice needed

风格不统一 提交于 2020-02-24 11:07:27
问题 I am developing a Java EE based web application. We have a very limited time to come up with a alpha version and trying to decide on a web framework to use. It has to be something easy to learn but powerful. Standard JSP/Servlet is not an option here due to the time it takes for the development. Appreciate if anyone could advice. Current options are Wicket and GWT. (JSF is also an option) 回答1: Wicket is component-based and comes with a bunch of standard components (like pagination, auto

Wicket vs GWT - Advice needed

你。 提交于 2020-02-24 11:06:30
问题 I am developing a Java EE based web application. We have a very limited time to come up with a alpha version and trying to decide on a web framework to use. It has to be something easy to learn but powerful. Standard JSP/Servlet is not an option here due to the time it takes for the development. Appreciate if anyone could advice. Current options are Wicket and GWT. (JSF is also an option) 回答1: Wicket is component-based and comes with a bunch of standard components (like pagination, auto

Preserving bean values between views

余生长醉 提交于 2020-02-24 04:06:45
问题 I'm looking for best practices regarding preserving bean values between views using JSF 2. Consider the following scenario: * In view A, the view scoped bean ABean is instantiated and retrieves data for display in the view. * In view A you can click on an entry to view details for it in view B. * When returning from view B to view A, the data previously retrieved by ABean is displayed. What is the best way to preserve the data retrieved by ABean, to be able to display it again when returning