Hi
i want to know if this is an efficient way to download some files

i want my users to be able to download certain files just to registerd users
only so i can put that logic in the page constructor
but is this efficient way to do this as this may be called thausands of
times per hour   (the files generated dynamically)
does the construction of a page and all the other bits is heavy for such a
task

i am using spring MVC right now with its rest style model and annotation but
it seems to me too heavyweight for the task

so is this appropriate?
is there another way more efficient?

public class DownloadManagerPage extends WebPage{
    private static final long serialVersionUID = 1L;

    public DownloadManagerPage(PageParameters parameters) {
        super(parameters);
        if (registeredUser(parameters)) {
            getRequestCycle().setRequestTarget(new
ResourceStreamRequestTarget(new AbstractResourceStreamWriter() {
                private static final long serialVersionUID = 1L;
                public void write(OutputStream output) {
                            output........
                }

                public String getContentType() {
                    return ......;
                }
            }));
        }
    }

    private boolean registeredUser(PageParameters parameters) {
        return ....;
    }
}

thanks in advance
Joe

Reply via email to