jsf

无责任书评:每个Java程序员都应该深入理解Java虚拟机

落爺英雄遲暮 提交于 2020-08-08 13:50:13
Java这门语言的发展是很有意思的,它不像Python, Ruby 等完全是开源社区驱动,也不像C#,VB.NET主要由微软操刀。它是一个以Oracle(之前是Sun)为主,各大巨头一起参与,一起制定标准的一门语言。 想对Java添加一点特性, 得走JCP流程,巨头们要审查,看看对自己是否有利,然后投票决定。 在Java的生态中, 官方曾经制定了很多技术和标准,什么Applet, JSP, EJB,JSF, JavaFX...... 但是大部分都被淘汰了,原因很简单,这些标准制定的周期很长, 难以跟上软件行业迅速的变化,等到各大厂商再把实现给搞定,黄花菜都凉了。 所以大家最常用的反而是开源的框架和工具如Spring。 但是Java 语言本身和Java虚拟机是个例外,因为他们不需要也不可能像应用层那样剧烈变化,所以作为后端程序员,对他们进行“投资”是最划算的。 所以我们今天就来聊聊Java虚拟机的书籍。写这方面的书很多, 比如我最早看的就是这一本。 我个人认为这是相当不错的一本书,它在讲ClassLoader 的时候举了一个例子,如果没有双亲委托模型,不怀好意的那些java class 很容易会破坏你的系统,这个例子让我印象如此深刻,以至于我在写《我是一个Java Class》的时候,也编了一个类似的例子。 这本书还花了大量的篇幅讲解Java Class的文件格式,整数运算

Is it necessary to invoke setValid(true) in decode() in a JSF Custom Component?

雨燕双飞 提交于 2020-08-08 06:15:38
问题 While working with a custom component I have the problem, that UIInput#getValid() never resets itself. Question is: do I have to invoke setValid(true) myself during Apply Request Values Phase? Here are the steps I have done: Create a custom component and inherit from UIInput The component invokes setConverter in the constructor The converter was designed for this component alone and throws a ConverterException if it can't convert from String to the model object There are no validators decode(

How to validate if a outputText is filled on JSF?

帅比萌擦擦* 提交于 2020-08-05 07:14:21
问题 Let me explain the scenario, assume that I have an class Project which contains a list of people, and you can search the a person and write his tasks on the project. Alright, so, I have a button to add people which leads to a modal, with the fields to fill and a search button... This search button, leads to another modal which is a simple person search, you type the name, select one from the list, the search modal closes and the name goes to an outputText on the previous modal. The thing is,

在HTML文件中包含另一个HTML文件

大憨熊 提交于 2020-07-27 08:56:17
问题: I have 2 HTML files, suppose a.html and b.html . 我有2个HTML文件,假设 a.html 和 b.html 。 In a.html I want to include b.html . 在 a.html 我想包含 b.html 。 In JSF I can do it like that: 在JSF中,我可以这样做: <ui:include src="b.xhtml" /> It means that inside a.xhtml file, I can include b.xhtml . 这意味着在 a.xhtml 文件中,我可以包含 b.xhtml 。 How can we do it in *.html file? 我们如何在 *.html 文件中执行此操作? 解决方案: 参考一: https://stackoom.com/question/biPX/在HTML文件中包含另一个HTML文件 参考二: https://oldbug.net/q/biPX/Include-another-HTML-file-in-a-HTML-file 来源: oschina 链接: https://my.oschina.net/u/4432649/blog/4405729

Primefaces datatable update in f:facet name=“header” not working

ぐ巨炮叔叔 提交于 2020-07-23 17:28:15
问题 I want to update a button in the header facet of a primefaces datatable and it does not work. I copied the button outside the datatable everything works fine. The update should happen when the filter event of the datatable gets fired. I explicitly update the datatable, the outside- and the inside-button. The intention is to display a button with an icon when no filter is set and another icon when a filter is used. In this example I simplyfied the use case: when no filter is used there is a

Primefaces datatable update in f:facet name=“header” not working

隐身守侯 提交于 2020-07-23 17:25:38
问题 I want to update a button in the header facet of a primefaces datatable and it does not work. I copied the button outside the datatable everything works fine. The update should happen when the filter event of the datatable gets fired. I explicitly update the datatable, the outside- and the inside-button. The intention is to display a button with an icon when no filter is set and another icon when a filter is used. In this example I simplyfied the use case: when no filter is used there is a

Custom FORM authentication in Jakarta EE 8: can't leave login page after authentication

无人久伴 提交于 2020-07-20 04:14:30
问题 Java 11 Jakarta EE 8 Wildfly 20 I decided to give a try to the new authentication mechanism called "Custom FORM" authentication from Java EE Security that I saw in BalusC's book The Definitive Guide To JSF in Java EE 8 . I created a simple application to test it and it's not working. The problem is that after a successful authentication, I'm not redirected to the welcome page, I keep in the login page. It's as if the application didn't recognize that I'm authenticated. These are the relevant

Custom FORM authentication in Jakarta EE 8: can't leave login page after authentication

℡╲_俬逩灬. 提交于 2020-07-20 04:12:01
问题 Java 11 Jakarta EE 8 Wildfly 20 I decided to give a try to the new authentication mechanism called "Custom FORM" authentication from Java EE Security that I saw in BalusC's book The Definitive Guide To JSF in Java EE 8 . I created a simple application to test it and it's not working. The problem is that after a successful authentication, I'm not redirected to the welcome page, I keep in the login page. It's as if the application didn't recognize that I'm authenticated. These are the relevant

Login not forwarding correctly with CustomFormAuth and o:form

99封情书 提交于 2020-07-15 09:22:10
问题 I'm trying to implement Jakarta Security on my web project, to do so I'm following the amazing "The Definitive Guide to JSF in Java EE 8" by Bauke Scholtz and Arjan Tijms but it seems that I'm hitting a wall. When I type in a restricted url in the address bar the forward happens properly and I see the login page but after submitting the form the page is not redirected and the login page seems to be reloaded (the fields are emptied, but the url in the address bar is still the one from the

Spring Security 4 and PrimeFaces 5 AJAX request handling

帅比萌擦擦* 提交于 2020-07-14 09:48:49
问题 Good Day. I've created a PrimeFaces 5 project (JSF 2.2) which makes use of Spring Security 4. I'm attempting to make use of p:dataTable control with single selection enabled, which through an ajax call, updates a p:pickList control. The problem is related with Spring Security. If I deactivate the security of the page where my page controls are located (admin.faces), the ajax behavior works fine. But if I activate security, I get 403 status codes and the pickList doesn't get updated. I must