Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Execute method on load alternative

<f:metadata>
    <f:viewParam name="token" value="#{authenticator.token}" />
    <f:event type="preRenderView" listener="#{authenticator.check}" />
</f:metadata>
Comment

Execute method on load alternative

@ManagedBean
@RequestScoped
public class Authenticator {

    private String token;

    public void check() throws IOException {
        if (!isValid(token)) {
            FacesContext.getCurrentInstance().getExternalContext().redirect("main.jsf");
        }
    }

    // Getter/setter.
}
Comment

PREVIOUS NEXT
Code Example
Java :: android java close keyboard 
Java :: bluetooth chat example android client 
Java :: POM error: Failure to find org.springframework.boot 
Java :: square oot of 154 
Java :: how to extract word from string in java 
Java :: android system navigation back bar hide 
Java :: search in row and column sorted matrix leetcode 
Java :: how to stop extending jpa repository to every class in java 
Java :: Demo Example 
Java :: split by asterisk java 
Java :: arraylist to java 
Java :: how to remove all components from layeredPane java 
Java :: java GLIBC 2 34 missing 
Java :: filterreader converts a string to uppercase java 
Java :: copy and deletion of div by pressing button in javasript 
Java :: how to switch between two stylesheets in javafx. 
Java :: set integer array value to null java 
Java :: javax.servlet.Filter 
Java :: scanner.nextInt stream api java 
Java :: java.lang.String cannot be cast to java.util.Map 
Java :: Java Protected Access Modifier package two 
Java :: Switch statement expressions jdk12+ 
Java :: java spring crudrepository generate insert instead of update 
Java :: java.lang.noclassdeffounderror even though class is present 
Java :: how to add 0 in left padding using regular expression java 
Java :: Child inside NestedScrollView not cover full height of screen 
Java :: setUndecorated java 
Java :: how to wirte an XPlane Plugin 
Java :: how many return values can a method hava java 
Java :: java.sql.SQLException: Invalid column index 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =