Re: [Wicket-user] Writing byte[] to a WebResponse

2007-05-08 Thread JulianS
Janos Cserep wrote: > > 4. modify getContentType() and getData() to return your objects (you can > get > any HTTP parameter with the getParameter() call of the Resource class in > getData() so you could pass arguments to theURL like > http://server/context/.../my/resource/url?id=XkdfG12 > It t

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Igor Vaynberg
Gesendet:* Mittwoch, 3. Januar 2007 18:13 *An:* wicket-user@lists.sourceforge.net *Betreff:* Re: [Wicket-user] Writing byte[] to a WebResponse or even easier (if you dont need a bookmarkable url) abstract class ByteArrayLink extends Link { protected abstract byte[] getbytes(); protected abstract S

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Korbinian Bachl
free" _ Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Igor Vaynberg Gesendet: Mittwoch, 3. Januar 2007 18:13 An: wicket-user@lists.sourceforge.net Betreff: Re: [Wicket-user] Writing byte[] to a WebResponse or even easier (if you dont need a bookmarkable url) abstra

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Igor Vaynberg
or even easier (if you dont need a bookmarkable url) abstract class ByteArrayLink extends Link { protected abstract byte[] getbytes(); protected abstract String getfilename(); public void onclick() { getRequestCycle().setRequestTarget(new IRequestTarget() { void detach(RequestCycle rc) {} O

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Janos Cserep
Very short, very quick DynamicWebResource tutorial:) 1. Subclass DynamicWebResource public class MyResource extends DynamicWebResource { @Override protected DynamicWebResource.ResourceState getResourceState() { return new ResourceState() { public byte[] getData() { return "Example".t

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Philip A. Chapman
; [mailto:[EMAIL PROTECTED] Im Auftrag von > Philip A. Chapman > Gesendet: Mittwoch, 03. Jänner 2007 12:03 > An: wicket-user@lists.sourceforge.net > Betreff: Re: [Wicket-user] Writing byte[] to a WebResponse > > > > > The reason you're getting errors in MS Word

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Martijn Dashorst
working? > > Perhaps you could give me a short example > > Thanks > Robert > > > > Von: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Im > Auftrag von Philip A. Chapman > Gesendet: Mittwoch, 03. Jänner 2007 12:03 > An: wicket-user

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Thullner, Robert
: Re: [Wicket-user] Writing byte[] to a WebResponse The reason you're getting errors in MS Word is that you're converting a byte array into a String using ByteArrayOutputStream's toString() method. A Java String and a byte array are not always the same thing due to uni

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Philip A. Chapman
The reason you're getting errors in MS Word is that you're converting a byte array into a String using ByteArrayOutputStream's toString() method. A Java String and a byte array are not always the same thing due to unicode. Subclass wicket.markup.html.DynamicWebResource so that it returns the corr

Re: [Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Martijn Dashorst
Take a look at DynamicWebResource If you need an example, look at the wicket-contrib-jasperreports code in wicket-stuff svn. Martijn On 1/3/07, Thullner, Robert <[EMAIL PROTECTED]> wrote: > > > > Hello > > I store a lot of MS Word and Excel files as a byte[] into my database. > I want to add a f

[Wicket-user] Writing byte[] to a WebResponse

2007-01-03 Thread Thullner, Robert
Hello I store a lot of MS Word and Excel files as a byte[] into my database. I want to add a feature to download these files from the database again, but I did not find a way to do this in Wicket, without writing the byte[] to a File again. Is there a way to write a byte[] to a WebResponse? I tri