public class FormManagerImpl extends Object implements FormManager
Constructor and Description |
---|
FormManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
destroyToken(javax.servlet.http.HttpServletRequest request,
String token)
销毁一个表单
|
String |
dumpForm(javax.servlet.http.HttpServletRequest request,
String token)
打印表单信息。
|
Form |
getForm(javax.servlet.http.HttpServletRequest request,
String formToken)
获取表单
|
protected Map<String,Form> |
getForms(javax.servlet.http.HttpServletRequest request)
获得目前session中的表单列表。
|
protected Map<String,String> |
getNamedParameters(javax.servlet.http.HttpServletRequest request,
String[] names)
从Request中获得指定名称的参数。如果表单项是多选,有多个数据,则进行合并,以“|”分割。
|
boolean |
hasForm(javax.servlet.http.HttpServletRequest request,
String token)
判断表单是否存在。如果token为null,直接返回false。
|
boolean |
hasFormToken(javax.servlet.http.HttpServletRequest request)
访问参数中是否存在表单Token。
|
boolean |
isModified(javax.servlet.http.HttpServletRequest request,
String token)
比较表单数据是否有变化
|
Form |
newForm(javax.servlet.http.HttpServletRequest request)
生成一个新的表单,如果目前表单个数大于设定的最大表单数则先删除最早的一个表单。
新表单用RandomStringUtils.randomAlphanumeric(32)生成Token。 |
Form |
newForm(javax.servlet.http.HttpServletRequest request,
String url)
生成一个新的表单,如果目前表单个数大于设定的最大表单数则先删除最早的一个表单。
新表单用RandomStringUtils.randomAlphanumeric(32)生成Token。 |
protected void |
removeOldestForm(javax.servlet.http.HttpServletRequest request)
删除最老的Form
|
void |
setMaxFormNum(int maxFormNum) |
public void destroyToken(javax.servlet.http.HttpServletRequest request, String token)
FormManager
destroyToken
in interface FormManager
public String dumpForm(javax.servlet.http.HttpServletRequest request, String token)
FormManager
dumpForm
in interface FormManager
public boolean hasForm(javax.servlet.http.HttpServletRequest request, String token)
hasForm
in interface FormManager
public boolean hasFormToken(javax.servlet.http.HttpServletRequest request)
FormManager
hasFormToken
in interface FormManager
public boolean isModified(javax.servlet.http.HttpServletRequest request, String token)
isModified
in interface FormManager
public Form newForm(javax.servlet.http.HttpServletRequest request)
newForm
in interface FormManager
public Form newForm(javax.servlet.http.HttpServletRequest request, String url)
public Form getForm(javax.servlet.http.HttpServletRequest request, String formToken)
FormManager
getForm
in interface FormManager
protected Map<String,Form> getForms(javax.servlet.http.HttpServletRequest request)
protected Map<String,String> getNamedParameters(javax.servlet.http.HttpServletRequest request, String[] names)
ServletRequest.getParameterMap()
protected void removeOldestForm(javax.servlet.http.HttpServletRequest request)
destroyToken(HttpServletRequest, String)
public void setMaxFormNum(int maxFormNum)
Copyright © 2006–2018 TinyGroup. All rights reserved.