jsf

How do I protect JSF 2.0 facelets against direct access?

流过昼夜 提交于 2021-02-07 02:50:31
问题 I have found one idea here, putting files under /WEB-INF is a way to block direct access: With Facelets, one can also put XHTML files under the /WEB-INF, if they are templates or included files (same restrictions as with JSP essentially). The page also presents a solution based on Java EE security, which allows direct XHTML access only to members of a specific user group. <security-constraint> <display-name>Restrict XHTML Documents</display-name> <web-resource-collection> <web-resource-name

How do I protect JSF 2.0 facelets against direct access?

折月煮酒 提交于 2021-02-07 02:50:01
问题 I have found one idea here, putting files under /WEB-INF is a way to block direct access: With Facelets, one can also put XHTML files under the /WEB-INF, if they are templates or included files (same restrictions as with JSP essentially). The page also presents a solution based on Java EE security, which allows direct XHTML access only to members of a specific user group. <security-constraint> <display-name>Restrict XHTML Documents</display-name> <web-resource-collection> <web-resource-name

Spring Boot JSF packaging as a JAR

谁说我不能喝 提交于 2021-02-06 13:55:12
问题 I am trying to create a spring boot app with jsf and gradle. So far, during development everything was fine. When I wanted to run my App I just typed gradle bootRun, the app started and I was able to access it under 'localhost'. Now I am at a point of time, where I want to deploy the app, therefore I run the command 'gradle clean distTar' which creates the tar file to deploy. After running the generated script and accessing my app via Browser I just get an 404 with the message. index.xhtml

How to validate whether my form is valid from an oncomplete function in a b:commandButton?

扶醉桌前 提交于 2021-02-05 07:40:38
问题 I'm using bootsfaces 1.3.0 from maven repository and I'm trying to use this commandButton example that is in the docs (https://showcase.bootsfaces.net/forms/commandButton.jsf): <b:commandButton value="Ajax Modal" ajax="true" update="form:inform amodal" look="inverse" oncomplete="if(validationFailed) alert('Please enter valid input before opening the modal'); else $('#amodal').modal('show')" /> It fails because it says validationFailed is not defined. Could somebody help me with showing me how

Passing parameter from xhtml through p:remoteCommand to java bean not working

為{幸葍}努か 提交于 2021-01-29 06:45:59
问题 I'm using p:fileUpload component from which I need to pass to java bean class, number of files which will be uploaded. Count of files is available here PrimeFaces.widgets.<widget_name>.files.length . So I'm trying to pass this value to java bean through p:remoteCommand , but for some reason method defined in action parameter is called, but parameter is not passed. I'm using Primefaces 2.1 ... I know that is prehistorical version, but I need to fix one bug in application which is using this

Exclude RichFaces JS files in CombinedResourceHandler

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 04:24:25
问题 Is it possible for the CombinedResourceHandler to ignore RichFaces JS files? When I let omnifaces combine all JS files, including RichFaces with Richfaces optimisation off <context-param> <param-name>org.richfaces.resourceOptimization.enabled</param-name> <param-value>false</param-value> </context-param> I get the following exception SEVERE: Error Rendering View[/login.xhtml] java.lang.UnsupportedOperationException at org.richfaces.resource.ExternalStaticResource.getURL(ExternalStaticResource

Exclude RichFaces JS files in CombinedResourceHandler

允我心安 提交于 2021-01-29 04:23:47
问题 Is it possible for the CombinedResourceHandler to ignore RichFaces JS files? When I let omnifaces combine all JS files, including RichFaces with Richfaces optimisation off <context-param> <param-name>org.richfaces.resourceOptimization.enabled</param-name> <param-value>false</param-value> </context-param> I get the following exception SEVERE: Error Rendering View[/login.xhtml] java.lang.UnsupportedOperationException at org.richfaces.resource.ExternalStaticResource.getURL(ExternalStaticResource

No redirection after button click

戏子无情 提交于 2021-01-28 22:03:25
问题 I am new to jsf and trying to build app. Problem is when i click Login commandButton nothing happens. So i input some print lines and it show's me that connection with database exist and arguments are valid but it wont redirect. Here is index.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:h="http://xmlns.jcp.org/jsf/html"

Scan a QR code and decode it using p:photoCam

半腔热情 提交于 2021-01-28 21:19:51
问题 I need to capture and read a QR Code while the camera is capturing, all of this in a JSF Application. I have already read a QR Code in a photo, but for now I have to make it "alive". Anyone has any suggestion? I'm trying to use the p:photoCam of PrimeFaces. This is the method, using Zxing to read the QR code: /** * * @param filePath * @param charset * @param hintMap * * @return Qr Code value * * @throws FileNotFoundException * @throws IOException * @throws NotFoundException */ public static

How to load a JavaScript file on all pages programmatically

社会主义新天地 提交于 2021-01-28 12:22:15
问题 I have a jsf jar library, and I want to load a specific JavaScript file (exist in the jar) in all pages of the JSF 2.2 project that use it, and without any additional configuration. I want to load a specific JavaScript file exist in my library without use of h:outputScript tag in the page( Neither the template nor the page ) Is this possible in jsf web application? 回答1: You can use UIViewRoot#addComponentResource() to programmatically add JSF resources. You can use a SystemEventListener on