public class TokenProcessor extends Object
Utility methods supporting the generation and validation of transaction tokens, used to avoid duplicate form submits.
$Id: TokenProcessor.java 464373 2006-10-16 04:21:54Z rahul $Constructor and Description |
---|
TokenProcessor() |
Modifier and Type | Method and Description |
---|---|
String |
generate(javax.faces.context.FacesContext context)
Generate and return the next transaction token value, and store it
so that it may be verified on a subsequent form submit.
|
boolean |
verify(javax.faces.context.FacesContext context,
String token)
Verify that the specified transaction token value (retrieved from an
incoming request) is a valid transaaction token.
|
public String generate(javax.faces.context.FacesContext context)
Generate and return the next transaction token value, and store it so that it may be verified on a subsequent form submit.
context
- FacesContext
for the current requestpublic boolean verify(javax.faces.context.FacesContext context, String token)
Verify that the specified transaction token value (retrieved from an incoming request) is a valid transaaction token. In addition, remove it from any stored cache of tokens, so that it may not be reused.
context
- FacesContext
for the current requesttoken
- Transaction token to be verifiedTrue
if this token has been verified,
else false
Copyright © 2004-2013 Apache Software Foundation. All Rights Reserved.