Hi,
You can mount with a coding strategy in Application.init, something like .. (I
do it for attachment)
mount(new MyMixedParamUrlCodingStrategy("/images", Page.class, new String[] {
"id", "move" }) {
@Override
public IRequestTarget decode(RequestParameters
requestParameters) {
try {
ValueMap params =
decodeParameters(requestParameters.getPath().substring(getMountPath().length()),
requestParameters.getParameters());
String id = params.getString("id");
String move = params.getString("move");
if (StringUtils.isNotBlank(id)) {
...
return new ResourceStreamRequestTarget(...);
}
return new
WebErrorCodeResponseTarget(HttpServletResponse.SC_NOT_FOUND);
//return super.decode(requestParameters);
} catch (RuntimeException exc) {
throw exc;
} catch (Exception exc) {
throw new RuntimeException("wrap: " + exc.getMessage(),
exc);
}
}
});
/david
Leszek Gawron wrote:
Hello,
I already know how to serve an image from database - dead easy. Thing is
the image is a component. What i would like to achieve now is to have a
very small image retrieving api:
http://host/mywicketapp/images/<id>
http://host/mywicketapp/images/<id>/next
http://host/mywicketapp/images/<id>/previous
http://host/mywicketapp/images/latest
how do I mount a Resource at specified path?
how do I pass parameters to it ? (/next /previous)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]