public class ForwardUtil
extends com.labvantage.sapphire.BaseClass
Constructor and Description |
---|
ForwardUtil() |
ForwardUtil(javax.servlet.ServletRequest request)
Use this constructor to ensure CSRF attack protection of the form generated by this object
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getForm(java.lang.String formid,
java.lang.String action,
java.lang.String method,
boolean autosubmit)
Returns a String containing the text to generate the HTML form.
|
java.lang.String |
getForm(java.lang.String formid,
java.lang.String action,
java.lang.String method,
boolean autosubmit,
boolean parseURLToForm)
Returns a String containing the text to generate the HTML form.
|
java.lang.String |
getURLParams()
Returns a query string (e.g.
|
void |
setProperties(java.util.HashMap props)
Add a collection of property/value pairs.
|
void |
setProperty(java.lang.String propertyid,
java.lang.String value)
Add a property/value pair.
|
public ForwardUtil()
public ForwardUtil(javax.servlet.ServletRequest request)
request
- - the request object from jsp or ajax request.public void setProperty(java.lang.String propertyid, java.lang.String value)
propertyid
- the name of the property - this will be come the name of the hidden input tagvalue
- the value to put into the form - this will become the value attribute of the hidden input tagpublic void setProperties(java.util.HashMap props)
props
- contains a collection of property/value pairs. The Map keys will become the names of the input tags and the Map values will be tag value attributes.public java.lang.String getForm(java.lang.String formid, java.lang.String action, java.lang.String method, boolean autosubmit)
formid
- the id that will be given to the formaction
- the form action. This will typically be a URL for a JSP or Servlet.method
- the form method. Typically, either "Get" or "Post".autosubmit
- true will force the form to be submitted by the webpage as soon as the form has been rendered.public java.lang.String getForm(java.lang.String formid, java.lang.String action, java.lang.String method, boolean autosubmit, boolean parseURLToForm)
formid
- the id that will be given to the formaction
- the form action. This will typically be a URL for a JSP or Servlet.method
- the form method. Typically, either "Get" or "Post".autosubmit
- true will force the form to be submitted by the webpage as soon as the form has been rendered.parseURLToForm
- true will parse the action into it's query parts and create input field.public java.lang.String getURLParams()