jsf

How to get the uploaded file path in JSF

ぐ巨炮叔叔 提交于 2020-01-25 23:03:22
问题 I'm importing Excel document for reading and displaying the content in the UI. I need to know how to get the path of the file uploaded using browse in order to read the content of the excel file. 回答1: I need to know how to get the path of the file uploaded using browse in order to read the content of the excel file. There's a major thinking mistake here. Imagine that I am the client who want to upload the file and that you are the server who need to get the file's contents. I give you the

Get managed bean and type bound to “value” attribute

﹥>﹥吖頭↗ 提交于 2020-01-25 21:42:47
问题 Let's suppose I have following structure: 1) Managed Bean: @ViewScoped @ManagedBean public class TestBean { private Test test; //getters/setters } 2) Test class: public class Test { private String attribute; //gets/sets } 3) XHTML <p:inputText id="test" value="#{testBean.test.atribute}" /> Now, I know there is a way to find and get component instance: UIComponent c = view.findComponent(s); From UIComponent, how do I get the type bound to component? What I need is to get full qualified class

JSF之Action 与ActionListener的区别

六眼飞鱼酱① 提交于 2020-01-25 16:59:26
事件 检验 参数 事件产生 页面跳转 Action 有 无参数,不传入当前控件,有返回值 当铵钮被单击时产生事件.提交表单 返回页面---根据配置文件跳转 ActionListener 有 传入当前控件,无返回值 当铵钮被单击时产生事件.提交表单 返回本页面 ValueChangeListener 有 传入当前控件,无返回值 不提交表单(需指定其on change/on click="submit"才自动提交表单 返回本页面 act ion():处理的是业务逻辑.实际上JSF会自动产生一个"预设的ActionListener"来处理事件,并根据其返回值决定页面跳转,第五阶段调用应用执行会影响到页面间的导航(navigation),主要处理一些业务逻辑并返回几个业务逻辑结果(String类型),JSF的导航系统将会根据这个来选择恰当的下一个页面.会提交表单. actionListener(ActionEvente):处理页面上组件的"监听事件",第五阶段调用应用执行不会影响到导航.主要操作当前页面内的组件,或者是进行一些业务模型上的改变,或者是修改backingbean(托管Bean)的属性等,并不会出现在页面间的跳转。会提交表单. valueChangeListener(ValueChangeEventevent):处理页面上组件值变化的"监听事件",第三阶段验证请求值"执行

How to set up csrf protection in jsf2.2 web application?

为君一笑 提交于 2020-01-25 10:14:33
问题 I have a jsf 2.2 web application without using the spring framework. I searched on google and found out that jsf 2.2 provides out of the box csrf protection and you just have to enable it . So I did that following this link. Jsf2.2 csrf demo And added this in my faces.config.xml file <protected-views> <url-pattern>/csrf_protected_page.xhtml</url-pattern> </protected-views> But how to set up url-pattern for all my .xhtml pages I have tried: <url-pattern>/*</url-pattern> <url-pattern>/*.xhtml<

JQuery Primefaces remoteCommand parameter issue

萝らか妹 提交于 2020-01-25 07:23:28
问题 My goal was to call this page with a queryString parameter (http://localhost:8080/page.html?scrapeU ... ://cnn.com and then try to pull the value from the requestparametermap off the facescontext but its null in my init method. My second option is to set an inputhidden in my jQuery(document).ready function but the below syntax doesn't work. Anyone know how to get this to work either way? Thanks for the help! <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01/

Wildfly does not have visibility of annotated JSF classes

六眼飞鱼酱① 提交于 2020-01-25 06:50:29
问题 I'm trying to migrate an old Glassfish JEE app over to a recent LTS of Wildfly, but I've hit on a confusing issue. The application implements JSF 2.0 and Primefaces 6, with the use of JSF/PF annotations for @ManagedBean etc. Some of these annotated classes are in a shared dependency and include Beans, Converters, and general JSF components. Some of these are eager, or otherwise only have an access point in the JSF XHTML, usually for a conditional display or render. With the application

IFrame not rendered in JSF if using external URL

五迷三道 提交于 2020-01-25 03:30:09
问题 When I use IFrame inside a JSF page that refering to external web page. the page isn't rendered. JSF Code: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <f:loadBundle basename="resources.application" var="msg" /> <h:head> <title>E-Payment Gateway</title>

Composite Component with f:convertNumber won't work

时光怂恿深爱的人放手 提交于 2020-01-25 01:51:57
问题 I made a JSF composite component which uses f:convertNumber . However, it cannot convert value. How is this caused and how can I solve it? currency.xhtml <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:f="http://java.sun.com/jsf/core"> <composite:interface> </composite:interface>

Primefaces GMap addMarker (JavaScript) + selectMarker (overlaySelectEvent)

青春壹個敷衍的年華 提交于 2020-01-25 01:12:06
问题 I have been struggling to combine both the GMap AddMarker and Selection examples from the Primefaces Showcase. What I try to achieve here is to get the overlaySelectEvent fired when clicking on a marker that has been added to the map using JavaScript, having also those markers in the map model, correctly in sync. JSF and JavaScript: <p:growl id="messages" showDetail="true" /> <p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID" style="width:600px;height:400px" model="#

Primefaces GMap addMarker (JavaScript) + selectMarker (overlaySelectEvent)

a 夏天 提交于 2020-01-25 01:12:06
问题 I have been struggling to combine both the GMap AddMarker and Selection examples from the Primefaces Showcase. What I try to achieve here is to get the overlaySelectEvent fired when clicking on a marker that has been added to the map using JavaScript, having also those markers in the map model, correctly in sync. JSF and JavaScript: <p:growl id="messages" showDetail="true" /> <p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID" style="width:600px;height:400px" model="#