org.apache.struts.util
public class TokenProcessor extends Object
Since: Struts 1.1
Field Summary | |
---|---|
static TokenProcessor | instance
The singleton instance of this class. |
long | previous
The timestamp used most recently to generate a token value. |
Constructor Summary | |
---|---|
protected | TokenProcessor()
Protected constructor for TokenProcessor. |
Method Summary | |
---|---|
String | generateToken(HttpServletRequest request)
Generate a new transaction token, to be used for enforcing a single
request for a particular transaction.
|
static TokenProcessor | getInstance()
Retrieves the singleton instance of this class. |
boolean | isTokenValid(HttpServletRequest request)
Return true if there is a transaction token stored in
the user's current session, and the value submitted as a request
parameter with this action matches it. |
boolean | isTokenValid(HttpServletRequest request, boolean reset)
Return true if there is a transaction token stored in
the user's current session, and the value submitted as a request
parameter with this action matches it. |
void | resetToken(HttpServletRequest request)
Reset the saved transaction token in the user's session. |
void | saveToken(HttpServletRequest request)
Save a new transaction token in the user's current session, creating
a new session if necessary.
|
String | toHex(byte[] buffer)
Convert a byte array to a String of hexadecimal digits and return it. |
Parameters: request The request we are processing
true
if there is a transaction token stored in
the user's current session, and the value submitted as a request
parameter with this action matches it. Returns false
under any of the following circumstances:
Parameters: request The servlet request we are processing
true
if there is a transaction token stored in
the user's current session, and the value submitted as a request
parameter with this action matches it. Returns false
Parameters: request The servlet request we are processing reset Should we reset the token after checking it?
Parameters: request The servlet request we are processing
Parameters: request The servlet request we are processing
Parameters: buffer The byte array to be converted