java.lang.Object
net.i2p.router.web.ContentOnly
Per-request utility for the opt-in console fragment mode. When a page is requested with a contentonly request parameter, only the named elements are rendered and the shared head/sidebar chrome is skipped, so auto-refresh ticks transfer and parse a fraction of the full page. Full-page requests (no contentonly parameter) are unaffected.
Pages opt in by gating each refresh target with render(HttpServletRequest, String); the chrome guards in head.jsi and sidebar.jsi are shared by every console page.
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionstatic booleanTrue when the request asks for fragment rendering.static booleanrender(HttpServletRequest req, String id) Whether the named element must be rendered for this request.The sanitized set of requested element ids.
Field Details
SPLIT
Splits the contentonly parameter on commas and whitespace.ELEMENT_ID
Element ids are [A-Za-z0-9_-] runs.
Constructor Details
ContentOnly
private ContentOnly()Utility class, not intended for instantiation.
Method Details
isContentOnly
True when the request asks for fragment rendering.- Parameters:
req- request whose contentonly parameter is inspected- Returns:
- true iff the contentonly parameter is present and non-empty
requestedIds
The sanitized set of requested element ids. Splits the parameter on commas and whitespace and keeps only ids matching [A-Za-z0-9_-].- Parameters:
req- request whose contentonly parameter supplies the ids- Returns:
- the requested ids, or an empty set
render
Whether the named element must be rendered for this request.- Parameters:
req- request whose contentonly parameter gates the renderingid- the element id- Returns:
- true for full-page requests, and for fragment requests that include the id