public class FormLinkRenderer extends org.apache.tapestry.link.DefaultLinkRenderer
Theoretically, browsers should support very long URLs, but in practice they often start behaving strangely if the URLs are more than 256 characters. This renderer uses JavaScript to generate forms containing the requested link parameters and then "post" them when the link is selected. As a result, the data is sent to the server using a POST request with a very short URL and there is no longer a limitation in the size of the parameters.
In short, simply add the following parameter to your DirectLink
,
ExternalLink
, or other such link components:
renderer="ognl: @org.apache.tapestry.contrib.link.FormLinkRenderer@RENDERER"and they will automatically start using POST rather than GET requests. Their parameters will no longer be limited in size.
Modifier and Type | Field and Description |
---|---|
static org.apache.tapestry.link.ILinkRenderer |
RENDERER
A public singleton instance of the
FormLinkRenderer . |
Constructor and Description |
---|
FormLinkRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
renderLink(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.components.ILinkComponent linkComponent) |
public static final org.apache.tapestry.link.ILinkRenderer RENDERER
FormLinkRenderer
.
Since the FormLinkRenderer
is stateless, this instance
can serve all links within your application without interference.
public FormLinkRenderer()
public void renderLink(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle, org.apache.tapestry.components.ILinkComponent linkComponent)
renderLink
in interface org.apache.tapestry.link.ILinkRenderer
renderLink
in class org.apache.tapestry.link.DefaultLinkRenderer