Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public StringResourceModel(final String resourceKey, final Component component,
	final IModel<?> model, final Object... parameters)

Wiki Markup
Where the Object\[\] array is matched to the first parameter of the ellipsis and the defaultValue as the second parameter.

Removed IComponentBorder

The interface has been removed since IBehavior can do exactly the same. MarkupComponentBorder has been migrated, which means you can add associated markup to the behavior. Markup which will surround the behavior's component.

...

Code Block
public class DynamicCssBehavior extends TextTemplateHeaderContributor
    public DynamicCssBehavior() {
        super(new CssTemplate(new MyTextTemplate()), new VariablesModel());
    }
    
    private static class VariablesModel extends AbstractReadOnlyModel<Map<String, Object>> {
        public Map<String, Object> getObject() {
            Map<String, Object> variables = new HashMap<String, Object>();
            variables.put("background", "#ff0000");
            return variables;
        }
    }
}

...

Code Block
public class DynamicCssBehavior extends Behavior {
    private TextTemplate template = CssTemplate(new MyTextTemplate());
    
    public void renderHead(Component component, IHeaderResponse response) {
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("background", "#ff0000");
        response.renderString(template.asString(variables));
}

...

Wicket 1.5 has improved support for caching. It gives you fine-grained control over caching behavior on of your package resources.

There are several out-of-the-box implementations of the interface

...

which provide different ways of adding caching related information your package resources (e.g. CSS, javascript, images, etc.). Also it's pretty easy to roll out your own strategy.

...

org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategySee the javadoc of the class for details.

(taken from javadoc of FilenameWithVersionResourceCachingStrategy){{

  • resource caching strategy that adds a version for the
  • requested resource to the filename.
  •  
  • Wiki Markup
    versioned_filename := \[{{basename\]\[version-prefix\]\[version\](.extension)

...

  • }}
  •  

Wiki Markup
In development mode
the version string is be last modified timestamp of the resource in UNIX milliseconds. If the resource resides in a jar the timestamp of the jar file will be taken instead.
 the&nbsp;\[version\] string is be last modified timestamp of the resource in UNIX milliseconds. If the resource resides in a jar the timestamp of the jar file will be taken instead.

Wiki Markup
In production mode the MD5 hash of the file content will be calculated and taken as \[{{version\]}}. The calculation will be done once and then be cached for the lifetime of the 
In production mode the MD5 hash of the file content will be calculated and taken as version. The calculation will be done once and be cached for the lifetime of the
application.

Example:

filename basename      = styles.css
last-modified = 1303741587000
md5-checksum  = F1336A3F160F1399ECF87B6196AB1C2A

decorated-filename-in-development-mode = styles-ver-1303741587000.css
decorated-filename-in-deploymenddeployment-mode  = styles-ver-F1336A3F160F1399ECF87B6196AB1C2A.css

So whenever the file changes the changed filename will cause a cache miss and the updated file will be requested from the server.

It will decorate the resource filename with a version. The version will be the timestamp of the file in development mode and the md5 hash in deployment mod.
merges the last modified timestamp of the resource into the base resource name. For a good description of For additional information on this style of caching see chapter

  Use fingerprinting to dynamically enable caching

in

  http://code.google.com/intl/de-DE/speed/page-speed/docs/caching.html

You can set your own a non-default caching strategy with

getResourceSettings().setCachingStrategy(...)

...

getResourceSettings().setCachingStrategy(org.apache.wicket.request.resource.caching.NoOpResourceCachingStrategy.INSTANCE)

...

(M4) Added support for 'x-forwarded-for' headers and more

Please see http://code.google.com/p/xebia-france/wiki/XForwardedFilterImage Removed which has been used as blueprint, though we are not using a ServletFilter. It's more tightly integrated to benefit from Wicket's core functionalities. See XForwardedRequestWrapperFactory and XForwardedRequestWrapper. The most convinient place to add them is via subclassing WebApplication.newWebRequest() in your own Application object.

...

1.4

1.5

org.apache.wicket.request.resource.ResourceReference

org.apache.wicket.request.resource.PackageResourceReference

org.apache.wicket.RedirectToUrlException

org.apache.wicket.request.flow.RedirectToUrlException

org.apache.wicket.Request

org.apache.wicket.request.Request

org.apache.wicket.RequestCycle

org.apache.wicket.request.cycle.RequestCycle

org.apache.wicket.RequestCycle.urlFor

org.apache.wicket.request.cycle.RequestCycle.renderUrlFor

org.apache.wicket.util.lang.Objects.cloneObject(Object)

org.apache.wicket.util.lang.WicketObjects.cloneObject(Object)

org.apache.wicket.protocol.http.WebRequest

org.apache.wicket.request.http.WebRequest

org.apache.wicket.protocol.http.WebResponse

org.apache.wicket.request.http.WebResponse

org.apache.wicket.request.target.basic.RedirectRequestTarget

RedirectRequestHandler

org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy

use PageParameters.getNamedParameter(String) with any IRequestHandler

org.apache.wicket.request.target.resource.ResourceStreamRequestTarget

import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler

org.apache.wicket.request.http.WebRequest.getHttpServletRequest()

org.apache.wicket.protocol.http.servlet.ServletWebRequest.getContainerRequest()

org.apache.wicket.protocol.http.WebApplication.newWebResponse(final HttpServletResponse)

(missing)

org.apache.wicket.Application.set(Application)

org.apache.wicket.ThreadContext.setApplication(Application)

org.apache.wicket.protocol.http.BufferedWebResponse.BufferedWebResponse(HttpServletResponse)

org.apache.wicket.protocol.http.BufferedWebResponse.BufferedWebResponse(WebResponse)

org.apache.wicket.PageParameters

org.apache.wicket.request.mapper.parameter.PageParameters

org.apache.wicket.PageParameters.put(String, String)

org.apache.wicket.request.mapper.parameter.PageParameters.set(String, Object)

org.apache.wicket.PageParameters.getInt(String)

org.apache.wicket.request.mapper.parameter.PageParameters.get(String).toInt()

org.apache.wicket.protocol.http.HttpSessionStore

org.apache.wicket.session.HttpSessionStore

org.apache.wicket.protocol.http.WebApplication.newSessionStore()

(missing, HttpSessionStore is the only supported)

org.apache.wicket.markup.html.resources.CompressedResourceReference

org.apache.wicket.request.resource.CompressedResourceReference

org.apache.wicket.markup.html.resources.JavascriptResourceReference

org.apache.wicket.request.resource.JavascriptResourceReference

org.apache.wicket.markup.html.image.Image.Image(String)

(this constructor is protected in 1.5, as replacement can be used NonCachingImage(String))

org.apache.wicket.markup.html.image.resource.DynamicImageResource

org.apache.wicket.request.resource.DynamicImageResource

org.apache.wicket.util.convert.ConverterLocator

org.apache.wicket.ConverterLocator

org.apache.wicket.util.lang.Objects

org.apache.wicket.util.lang.WicketObjects

org.apache.wicket.protocol.http.WebApplication.sessionDestroyed(String)

org.apache.wicket.protocol.http.WebApplication.sessionUnbound(String)

org.apache.wicket.protocol.https.HttpsRequestCycleProcessor

org.apache.wicket.protocol.https.HttpsMapper

org.apache.wicket.protocol.http.WebRequestCycle.newBrowserInfoPage(String)

org.apache.wicket.protocol.http.WebSession.newBrowserInfoPage(String)

org.apache.wicket.protocol.http.WebApplication.newWebRequest(HttpServletRequest)

org.apache.wicket.protocol.http.WebApplication.newWebRequest(HttpServletRequest, String)

org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletResponse)

org.apache.wicket.protocol.http.WebApplication.newWebResponse(HttpServletRequest, HttpServletResponse)

org.apache.wicket.protocol.http.WebApplication.mountBookmarkablePage(String, Class)

org.apache.wicket.protocol.http.WebApplication.mountPage(String, Class)

org.apache.wicket.resource.loader.IStringResourceLoader.loadStringResource(Component, String)

org.apache.wicket.resource.loader.IStringResourceLoader.loadStringResource(Component, String, Locale, String, String)

org.apache.wicket.ajax.IAjaxCallDecorator.decorateScript(CharSequence)

org.apache.wicket.ajax.IAjaxCallDecorator.decorateScript(Component, CharSequence)

org.apache.wicket.IResponseFilter (and all default implementations)

org.apache.wicket.response.filter.IResponseFilter

org.apache.wicket.markup.html.form.Form.process()

org.apache.wicket.markup.html.form.Form.process(IFormSubmittingComponent)

org.apache.wicket.Application.addComponentInstantiationListener()

org.apache.wicket.Application.getComponentInstantiationListeners().add()

org.apache.wicket.markup.html.DynamicWebResource

org.apache.wicket.request.resource.ByteArrayResource

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="187dc653-020d-4656-90db-fd774fc8c477"><ac:plain-text-body><![CDATA[

org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable.DataTable(String, IColumn<T>[], IDataProvider<T>, int)

org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable.DataTable(String, List<IColumn<T>>, IDataProvider<T>, int)

]]></ac:plain-text-body></ac:structured-macro>

org.apache.wicket.validation.IValidatorAddListener

Validator.bind(Component)

org.apache.wicket.behavior.AbstractBehavior.renderHead(IHeaderResponse)

org.apache.wicket.behavior.Behavior.renderHead(Component, IHeaderResponse)

org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy

org.apache.wicket.request.mapper.CryptoMapper

org.apache.wicket.util.template.PackagedTextTemplate

org.apache.wicket.util.template.PackageTextTemplate

org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort.AjaxFallbackOrderByLink.onAjaxClick(AjaxRequestTarget)

org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort.AjaxFallbackOrderByLink.onClick(AjaxRequestTarget)

org.apache.wicket.util.file.IFileUploadCleaner

org.apache.wicket.util.file.IFileCleaner