Re: DownloadLink hanging

2007-08-28 Thread Thomas Singer

you will be creating a ton of shared resources - one per file which isnt the
greatest


Why you think it is not good? We don't have too much available files ( 20). 
Would it be better to give each file resource a unique name instead of the 
empty string?



while being a bit more secure iin terms of what files are available for
download it still allows any user to download them and the urls are still
stable.


Well, how do you suggest to work around that problem? My only idea was to 
check the session state within the resource (license agreement accepted), 
but I'm not sure what to do when the session state does not allow the 
download. But this problem also occurs when making your suggested 
implementation save by passing just relative paths (relative to the common 
download directory on the server) rejecting invalid (e.g. with ../ 
starting) FILE_PARAM values.


--
Cheers,
Tom


Igor Vaynberg wrote:

i thought about that, two drawbacks

you will be creating a ton of shared resources - one per file which isnt the
greatest

while being a bit more secure iin terms of what files are available for
download it still allows any user to download them and the urls are still
stable. so if you are selling downloads this is obviously not going to work
for you.

-igor


On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

What do you think about passing the file as constructor parameter in the
FileResourceReference to avoid the security hole (passing the file name as
request parameter)?

--
Cheers,
Tom


Igor Vaynberg wrote:

here is a download link that doesnt block. notice that unlike the

original

it has no security - it's urls are stable and it will stream any file

off

your harddrisk. you can use it as a starting point to build a download

link

suited for your app.

-igor


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version

2.0

 * (the License); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or

implied.

 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.wicket.markup.html.link;

import java.io.File;

import org.apache.wicket.Resource;
import org.apache.wicket.ResourceReference;
import org.apache.wicket.Response;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.protocol.http.WebResponse;
import org.apache.wicket.util.resource.FileResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.value.ValueMap;


/**
 * @author Igor Vaynberg (ivaynberg)
 */
public class DownloadLink extends WebMarkupContainer
{
private static final String FILE_PARAM = file;
private static final long serialVersionUID = 1L;

public DownloadLink(String id, IModel model)
{
super(id, model);
}


protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
checkComponentTag(tag, a);
File file = (File)getModelObject();
FileResourceReference ref = new FileResourceReference();
ValueMap params = new ValueMap();
params.put(FILE_PARAM, file.getAbsolutePath());
tag.put(href, getRequestCycle().urlFor(ref, params));
}


/**
 *
 * @see org.apache.wicket.markup.html.link.Link#onClick()
 */
private static class FileResourceReference extends ResourceReference
{

public FileResourceReference()
{
super(DownloadLink.class, );
}

private static final long serialVersionUID = 1L;

protected Resource newResource()
{
return new Resource()
{
private static final long serialVersionUID = 1L;

public IResourceStream getResourceStream()
{
return new FileResourceStream(getFile());
}

protected void configureResponse(Response response)
{

((WebResponse)response).setAttachmentHeader(getFile().getName());
}

private File getFile()
{
return new

File(getParameters().getString(FILE_PARAM));

}

};
}

}
}


On 8/27/07, Matej Knopp [EMAIL PROTECTED] wrote:

The blocking is necessary in order not to corrupt session state. We

have

as
fine grained 

Re: DownloadLink hanging

2007-08-28 Thread Igor Vaynberg
see all these kinds of questions start coming up, that is why download link
is made the way it is. you have none of these worries and it is very secure
by default. so i think when it comes to these issues what i will be
concentrating on is making downloadlink not block. whether it will be for
1.3 or for 1.4

-igor


On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

  you will be creating a ton of shared resources - one per file which isnt
 the
  greatest

 Why you think it is not good? We don't have too much available files (
 20).
 Would it be better to give each file resource a unique name instead of the
 empty string?

  while being a bit more secure iin terms of what files are available for
  download it still allows any user to download them and the urls are
 still
  stable.

 Well, how do you suggest to work around that problem? My only idea was to
 check the session state within the resource (license agreement accepted),
 but I'm not sure what to do when the session state does not allow the
 download. But this problem also occurs when making your suggested
 implementation save by passing just relative paths (relative to the common
 download directory on the server) rejecting invalid (e.g. with ../
 starting) FILE_PARAM values.

 --
 Cheers,
 Tom


 Igor Vaynberg wrote:
  i thought about that, two drawbacks
 
  you will be creating a ton of shared resources - one per file which isnt
 the
  greatest
 
  while being a bit more secure iin terms of what files are available for
  download it still allows any user to download them and the urls are
 still
  stable. so if you are selling downloads this is obviously not going to
 work
  for you.
 
  -igor
 
 
  On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
  What do you think about passing the file as constructor parameter in
 the
  FileResourceReference to avoid the security hole (passing the file name
 as
  request parameter)?
 
  --
  Cheers,
  Tom
 
 
  Igor Vaynberg wrote:
  here is a download link that doesnt block. notice that unlike the
  original
  it has no security - it's urls are stable and it will stream any file
  off
  your harddrisk. you can use it as a starting point to build a download
  link
  suited for your app.
 
  -igor
 
 
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed
 with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version
  2.0
   * (the License); you may not use this file except in compliance
 with
   * the License.  You may obtain a copy of the License at
   *
   *  http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.wicket.markup.html.link;
 
  import java.io.File;
 
  import org.apache.wicket.Resource;
  import org.apache.wicket.ResourceReference;
  import org.apache.wicket.Response;
  import org.apache.wicket.markup.ComponentTag;
  import org.apache.wicket.markup.html.WebMarkupContainer;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.protocol.http.WebResponse;
  import org.apache.wicket.util.resource.FileResourceStream;
  import org.apache.wicket.util.resource.IResourceStream;
  import org.apache.wicket.util.value.ValueMap;
 
 
  /**
   * @author Igor Vaynberg (ivaynberg)
   */
  public class DownloadLink extends WebMarkupContainer
  {
  private static final String FILE_PARAM = file;
  private static final long serialVersionUID = 1L;
 
  public DownloadLink(String id, IModel model)
  {
  super(id, model);
  }
 
 
  protected void onComponentTag(ComponentTag tag)
  {
  super.onComponentTag(tag);
  checkComponentTag(tag, a);
  File file = (File)getModelObject();
  FileResourceReference ref = new FileResourceReference();
  ValueMap params = new ValueMap();
  params.put(FILE_PARAM, file.getAbsolutePath());
  tag.put(href, getRequestCycle().urlFor(ref, params));
  }
 
 
  /**
   *
   * @see org.apache.wicket.markup.html.link.Link#onClick()
   */
  private static class FileResourceReference extends
 ResourceReference
  {
 
  public FileResourceReference()
  {
  super(DownloadLink.class, );
  }
 
  private static final long serialVersionUID = 1L;
 
  protected Resource newResource()
  {
  return new Resource()
  {
  private static final long serialVersionUID = 1L;
 
  public IResourceStream getResourceStream()
  {
   

Re: DownloadLink hanging

2007-08-27 Thread Thomas Singer
Isn't fixing bugs the task of the Wicket developers? We don't have a problem 
ordering support, but I could not find information where to get it.


--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

if it is that urgent why not create a patch?

-igor


On 8/26/07, Thomas Singer [EMAIL PROTECTED] wrote:

BTW, as long as this issue is not fixed, we can't take our Wicket-based
website online. This is a show-stopper bug for us. :(

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Thomas Singer wrote:

Done: https://issues.apache.org/jira/browse/WICKET-878

Tom


Igor Vaynberg wrote:

yep

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

Should I report a bug in JIRA?

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

hm, this looks like an old bug. johan didnt we fix this a while ago?

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

inside shared
resource you can simply call Session.get() to get to wicket

session.

Unfortunately, it looks like this is not possible, because I'm

getting

following exception:


java.lang.IllegalStateException: you can only locate or create

sessions

in the context of a request cycle

  org.apache.wicket.Session.findOrCreate(Session.java:250)
  org.apache.wicket.Session.get(Session.java:279)
  com.syntevo.hpsmart.DownloadResource.getResourceStream(

DownloadResource.java:18)

  org.apache.wicket.protocol.http.WicketFilter.getLastModified(

WicketFilter.java:708)

  org.apache.wicket.protocol.http.WicketFilter.doFilter(

WicketFilter.java:122)

Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-27 Thread Gerolf Seitz
well, it kind of is the task of the developers, but it's totally up to them
to choose when they fix (or not fix) which bugs.
also, what keeps you from contributing?

anyway, companies providing commercial support are listed in the wiki:
http://cwiki.apache.org/WICKET/companies-that-provide-services.html

On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

 Isn't fixing bugs the task of the Wicket developers? We don't have a
 problem
 ordering support, but I could not find information where to get it.

 --
 Best regards,
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany
 www.syntevo.com


 Igor Vaynberg wrote:
  if it is that urgent why not create a patch?
 
  -igor
 
 
  On 8/26/07, Thomas Singer [EMAIL PROTECTED] wrote:
  BTW, as long as this issue is not fixed, we can't take our Wicket-based
  website online. This is a show-stopper bug for us. :(
 
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Thomas Singer wrote:
  Done: https://issues.apache.org/jira/browse/WICKET-878
 
  Tom
 
 
  Igor Vaynberg wrote:
  yep
 
  -igor
 
 
  On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Should I report a bug in JIRA?
 
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Igor Vaynberg wrote:
  hm, this looks like an old bug. johan didnt we fix this a while
 ago?
 
  -igor
 
 
  On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:
  inside shared
  resource you can simply call Session.get() to get to wicket
  session.
  Unfortunately, it looks like this is not possible, because I'm
  getting
  following exception:
 
  java.lang.IllegalStateException: you can only locate or create
  sessions
  in the context of a request cycle
org.apache.wicket.Session.findOrCreate(Session.java:250)
org.apache.wicket.Session.get(Session.java:279)
com.syntevo.hpsmart.DownloadResource.getResourceStream(
  DownloadResource.java:18)
 
 org.apache.wicket.protocol.http.WicketFilter.getLastModified(
  WicketFilter.java:708)
org.apache.wicket.protocol.http.WicketFilter.doFilter(
  WicketFilter.java:122)
 
  Our resource code looks like this:
 
  final class DownloadResource extends Resource {
 
public IResourceStream getResourceStream() {
  final OurSession session = (OurSession)Session.get();
  if (session == null) {
return null;
  }
 
  final File file = session.getFileToDownload();
  if (file == null) {
return null;
  }
 
  return new MyFileResourceStream(file);
}
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-27 Thread Eelco Hillenius
On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
 Isn't fixing bugs the task of the Wicket developers? We don't have a problem
 ordering support, but I could not find information where to get it.

It's unfortunate you have an urgent problem. Sorry about that.
However, everyone of the development team does most of the working on
Wicket, including following this very time consuming mailing list, in
their spare time.

Some of us joined in a support initiative:
http://www.wicket-support.com/, and you might be able to get some very
direct support there. For all I know they are pretty busy right now.
As long as Wicket doesn't have the same number of users as Spring of
JBoss, it's going to be very hard to build support that's always
available. And there are the companies listed at
http://cwiki.apache.org/WICKET/companies-that-provide-services.html
like Gerolf said.

Your best bet on getting quick support is to fix it yourself and send
in a patch. This is not because we're lazy, but because we're very
short on spare time. It may be easier than you think to provide a
patch, and maybe you get hire a wizard programmer somewhere who knows
his or her way around Wicket.

Regards,

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-27 Thread Thomas Singer

Your best bet on getting quick support is to fix it yourself and send
in a patch.


Well, if that would be possible, I would have done that or worked around it 
myself (like done with some own components).



http://www.wicket-support.com/


Sorry to say, but I hate websites where you can't find an address on it.

What Wicket core developer can provide support (e.g. because (s)he is 
working in the mentioned companies)? Or are you only working in your 
spare-time on Wicket?


Please understand me: I had a good feeling about Wicket, but this 
show-stopper problem makes me feel a little bit sick, because I don't know 
whether there are other such problems which prevent using Wicket for our 
website at all.


BTW, I still have the feeling, that if Wicket provides a feature to download 
something large (except normal pages), it must not block until this file is 
downloaded. My co-worker told me (I haven't verified), that he stopped the 
download and this also blocked Wicket. He had to restart Tomcat!


--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Eelco Hillenius wrote:

On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

Isn't fixing bugs the task of the Wicket developers? We don't have a problem
ordering support, but I could not find information where to get it.


It's unfortunate you have an urgent problem. Sorry about that.
However, everyone of the development team does most of the working on
Wicket, including following this very time consuming mailing list, in
their spare time.

Some of us joined in a support initiative:
http://www.wicket-support.com/, and you might be able to get some very
direct support there. For all I know they are pretty busy right now.
As long as Wicket doesn't have the same number of users as Spring of
JBoss, it's going to be very hard to build support that's always
available. And there are the companies listed at
http://cwiki.apache.org/WICKET/companies-that-provide-services.html
like Gerolf said.

Your best bet on getting quick support is to fix it yourself and send
in a patch. This is not because we're lazy, but because we're very
short on spare time. It may be easier than you think to provide a
patch, and maybe you get hire a wizard programmer somewhere who knows
his or her way around Wicket.

Regards,

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-27 Thread Matej Knopp
I've commited a possible fix. Can you plase try if it helps your problem?

-Matej

On 8/27/07, Eelco Hillenius [EMAIL PROTECTED] wrote:

 On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Isn't fixing bugs the task of the Wicket developers? We don't have a
 problem
  ordering support, but I could not find information where to get it.

 It's unfortunate you have an urgent problem. Sorry about that.
 However, everyone of the development team does most of the working on
 Wicket, including following this very time consuming mailing list, in
 their spare time.

 Some of us joined in a support initiative:
 http://www.wicket-support.com/, and you might be able to get some very
 direct support there. For all I know they are pretty busy right now.
 As long as Wicket doesn't have the same number of users as Spring of
 JBoss, it's going to be very hard to build support that's always
 available. And there are the companies listed at
 http://cwiki.apache.org/WICKET/companies-that-provide-services.html
 like Gerolf said.

 Your best bet on getting quick support is to fix it yourself and send
 in a patch. This is not because we're lazy, but because we're very
 short on spare time. It may be easier than you think to provide a
 patch, and maybe you get hire a wizard programmer somewhere who knows
 his or her way around Wicket.

 Regards,

 Eelco

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-27 Thread Eelco Hillenius
On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Your best bet on getting quick support is to fix it yourself and send
  in a patch.

 Well, if that would be possible, I would have done that or worked around it
 myself (like done with some own components).

  http://www.wicket-support.com/

 Sorry to say, but I hate websites where you can't find an address on it.

Maybe that's because we're all over the world! :) I think it is Matej
who set this up, and who is the principal guy behind it. He could put
his address there if he'd like.

 What Wicket core developer can provide support (e.g. because (s)he is
 working in the mentioned companies)? Or are you only working in your
 spare-time on Wicket?

I can't speak for all, but most of us have full time jobs. Which often
involves Wicket, but have their own schedules of course.

 Please understand me: I had a good feeling about Wicket, but this
 show-stopper problem makes me feel a little bit sick, because I don't know
 whether there are other such problems which prevent using Wicket for our
 website at all.

I hope none. To the upside, at least you have the source, can fix it
yourself or hire people for it, and we're usually moving pretty fast
compared to many competing web frameworks.

 BTW, I still have the feeling, that if Wicket provides a feature to download
 something large (except normal pages), it must not block until this file is
 downloaded. My co-worker told me (I haven't verified), that he stopped the
 download and this also blocked Wicket. He had to restart Tomcat!

Impossible. It can block the session until the request times out,
which is a minute or such.

Now back to your problem, if you get

 java.lang.IllegalStateException: you can only locate or create sessions in 
 the context of a request cycle
   org.apache.wicket.Session.findOrCreate(Session.java:250)
   org.apache.wicket.Session.get(Session.java:279)
   
 com.syntevo.hpsmart.DownloadResource.getResourceStream(DownloadResource.java:18)
   
 org.apache.wicket.protocol.http.WicketFilter.getLastModified(WicketFilter.java:708)
   
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:122)

how about for a work around just creating the request cycle before you
try to get the session? Kind of ugly but it might work until the bug
is found (I believe Igor thinks this is something for Johan to check
out).

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-27 Thread Matej Knopp
On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

  Your best bet on getting quick support is to fix it yourself and send
  in a patch.

 Well, if that would be possible, I would have done that or worked around
 it
 myself (like done with some own components).

  http://www.wicket-support.com/

 Sorry to say, but I hate websites where you can't find an address on it.


I think the email address is quite obvious.

What Wicket core developer can provide support (e.g. because (s)he is
 working in the mentioned companies)? Or are you only working in your
 spare-time on Wicket?


Please understand me: I had a good feeling about Wicket, but this
 show-stopper problem makes me feel a little bit sick, because I don't know
 whether there are other such problems which prevent using Wicket for our
 website at all.


Ever heard of open source?  Just think about it a little. You have a product
that a group of people spend lot of time developing and they are giving it
to you for free. So now just because your problem haven't been fixed in 10
hours, you feel sick about it?

BTW, I still have the feeling, that if Wicket provides a feature to download
 something large (except normal pages), it must not block until this file
 is
 downloaded. My co-worker told me (I haven't verified), that he stopped the
 download and this also blocked Wicket. He had to restart Tomcat!

It blocks only if that is a component request (it blocks on pagemap). If you
have large files you need to use shared resources that don't block. Also the
block is only one pagemap only (thus one session) and it lasts only for a
minute. No need to restart tomcat server.

-Matej


--
 Best regards,
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany
 www.syntevo.com


 Eelco Hillenius wrote:
  On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Isn't fixing bugs the task of the Wicket developers? We don't have a
 problem
  ordering support, but I could not find information where to get it.
 
  It's unfortunate you have an urgent problem. Sorry about that.
  However, everyone of the development team does most of the working on
  Wicket, including following this very time consuming mailing list, in
  their spare time.
 
  Some of us joined in a support initiative:
  http://www.wicket-support.com/, and you might be able to get some very
  direct support there. For all I know they are pretty busy right now.
  As long as Wicket doesn't have the same number of users as Spring of
  JBoss, it's going to be very hard to build support that's always
  available. And there are the companies listed at
  http://cwiki.apache.org/WICKET/companies-that-provide-services.html
  like Gerolf said.
 
  Your best bet on getting quick support is to fix it yourself and send
  in a patch. This is not because we're lazy, but because we're very
  short on spare time. It may be easier than you think to provide a
  patch, and maybe you get hire a wizard programmer somewhere who knows
  his or her way around Wicket.
 
  Regards,
 
  Eelco
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-27 Thread Thomas Singer

I think the email address is quite obvious.


I'm talking about real addresses. But as Eelco already stated, it might be 
hard to list them because you are scattered over the world. I'll accept that.



Ever heard of open source?  Just think about it a little. You have a product
that a group of people spend lot of time developing and they are giving it
to you for free.


Sure, I know the advantages (and disadvantages) of Open Source. I thank you 
for making Wicket freely available and try to spread good words about it (if 
possible).



So now just because your problem haven't been fixed in 10
hours, you feel sick about it?


No, I just feel (a little bit!) sick, that we've found such a IMHO major 
problem after having invested a couple of weeks work.



It blocks only if that is a component request (it blocks on pagemap). If you
have large files you need to use shared resources that don't block. Also the
block is only one pagemap only (thus one session) and it lasts only for a
minute. No need to restart tomcat server.


Most likely I don't understand the reasons behind the blocking, but from a 
user's point of view, a *download* never should block the application. The 
timeout (from the server side!) is also not very good for raising the 
website-user's trust.


I know we are ab-using Wicket a little bit for a web*site*, but when I think 
on a web*application* like JIRA, I also can't imagine at least one usecase 
(always from my user's point of view) which accepts a timeout or blocking 
when downloading a larger file.


--
Cheers,
Tom


Matej Knopp wrote:

On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

Your best bet on getting quick support is to fix it yourself and send
in a patch.

Well, if that would be possible, I would have done that or worked around
it
myself (like done with some own components).


http://www.wicket-support.com/

Sorry to say, but I hate websites where you can't find an address on it.



I think the email address is quite obvious.

What Wicket core developer can provide support (e.g. because (s)he is

working in the mentioned companies)? Or are you only working in your
spare-time on Wicket?



Please understand me: I had a good feeling about Wicket, but this

show-stopper problem makes me feel a little bit sick, because I don't know
whether there are other such problems which prevent using Wicket for our
website at all.



Ever heard of open source?  Just think about it a little. You have a product
that a group of people spend lot of time developing and they are giving it
to you for free. So now just because your problem haven't been fixed in 10
hours, you feel sick about it?

BTW, I still have the feeling, that if Wicket provides a feature to download

something large (except normal pages), it must not block until this file
is
downloaded. My co-worker told me (I haven't verified), that he stopped the
download and this also blocked Wicket. He had to restart Tomcat!


It blocks only if that is a component request (it blocks on pagemap). If you
have large files you need to use shared resources that don't block. Also the
block is only one pagemap only (thus one session) and it lasts only for a
minute. No need to restart tomcat server.

-Matej


--

Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Eelco Hillenius wrote:

On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

Isn't fixing bugs the task of the Wicket developers? We don't have a

problem

ordering support, but I could not find information where to get it.

It's unfortunate you have an urgent problem. Sorry about that.
However, everyone of the development team does most of the working on
Wicket, including following this very time consuming mailing list, in
their spare time.

Some of us joined in a support initiative:
http://www.wicket-support.com/, and you might be able to get some very
direct support there. For all I know they are pretty busy right now.
As long as Wicket doesn't have the same number of users as Spring of
JBoss, it's going to be very hard to build support that's always
available. And there are the companies listed at
http://cwiki.apache.org/WICKET/companies-that-provide-services.html
like Gerolf said.

Your best bet on getting quick support is to fix it yourself and send
in a patch. This is not because we're lazy, but because we're very
short on spare time. It may be easier than you think to provide a
patch, and maybe you get hire a wizard programmer somewhere who knows
his or her way around Wicket.

Regards,

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL 

Re: DownloadLink hanging

2007-08-27 Thread Matej Knopp
The blocking is necessary in order not to corrupt session state. We have as
fine grained locking as possible (under the circumstances). Web applications
are by nature multi-threaded. If you don't synchronize the access to certain
resources (sessions) you can get bugs that are very difficult to trace.

If you need download link, there are alternatives that don't block such as
shared resource.

-Matej

On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:

  I think the email address is quite obvious.

 I'm talking about real addresses. But as Eelco already stated, it might be
 hard to list them because you are scattered over the world. I'll accept
 that.

  Ever heard of open source?  Just think about it a little. You have a
 product
  that a group of people spend lot of time developing and they are giving
 it
  to you for free.

 Sure, I know the advantages (and disadvantages) of Open Source. I thank
 you
 for making Wicket freely available and try to spread good words about it
 (if
 possible).

  So now just because your problem haven't been fixed in 10
  hours, you feel sick about it?

 No, I just feel (a little bit!) sick, that we've found such a IMHO major
 problem after having invested a couple of weeks work.

  It blocks only if that is a component request (it blocks on pagemap). If
 you
  have large files you need to use shared resources that don't block. Also
 the
  block is only one pagemap only (thus one session) and it lasts only for
 a
  minute. No need to restart tomcat server.

 Most likely I don't understand the reasons behind the blocking, but from a
 user's point of view, a *download* never should block the application. The
 timeout (from the server side!) is also not very good for raising the
 website-user's trust.

 I know we are ab-using Wicket a little bit for a web*site*, but when I
 think
 on a web*application* like JIRA, I also can't imagine at least one usecase
 (always from my user's point of view) which accepts a timeout or blocking
 when downloading a larger file.

 --
 Cheers,
 Tom


 Matej Knopp wrote:
  On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Your best bet on getting quick support is to fix it yourself and send
  in a patch.
  Well, if that would be possible, I would have done that or worked
 around
  it
  myself (like done with some own components).
 
  http://www.wicket-support.com/
  Sorry to say, but I hate websites where you can't find an address on
 it.
 
 
  I think the email address is quite obvious.
 
  What Wicket core developer can provide support (e.g. because (s)he is
  working in the mentioned companies)? Or are you only working in your
  spare-time on Wicket?
 
 
  Please understand me: I had a good feeling about Wicket, but this
  show-stopper problem makes me feel a little bit sick, because I don't
 know
  whether there are other such problems which prevent using Wicket for
 our
  website at all.
 
 
  Ever heard of open source?  Just think about it a little. You have a
 product
  that a group of people spend lot of time developing and they are giving
 it
  to you for free. So now just because your problem haven't been fixed in
 10
  hours, you feel sick about it?
 
  BTW, I still have the feeling, that if Wicket provides a feature to
 download
  something large (except normal pages), it must not block until this
 file
  is
  downloaded. My co-worker told me (I haven't verified), that he stopped
 the
  download and this also blocked Wicket. He had to restart Tomcat!
 
  It blocks only if that is a component request (it blocks on pagemap). If
 you
  have large files you need to use shared resources that don't block. Also
 the
  block is only one pagemap only (thus one session) and it lasts only for
 a
  minute. No need to restart tomcat server.
 
  -Matej
 
 
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Eelco Hillenius wrote:
  On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Isn't fixing bugs the task of the Wicket developers? We don't have a
  problem
  ordering support, but I could not find information where to get it.
  It's unfortunate you have an urgent problem. Sorry about that.
  However, everyone of the development team does most of the working on
  Wicket, including following this very time consuming mailing list, in
  their spare time.
 
  Some of us joined in a support initiative:
  http://www.wicket-support.com/, and you might be able to get some very
  direct support there. For all I know they are pretty busy right now.
  As long as Wicket doesn't have the same number of users as Spring of
  JBoss, it's going to be very hard to build support that's always
  available. And there are the companies listed at
  http://cwiki.apache.org/WICKET/companies-that-provide-services.html
  like Gerolf said.
 
  Your best bet on getting quick support is to fix it yourself and send
  in a patch. This is not because we're lazy, but because we're very
  short on 

Re: DownloadLink hanging

2007-08-27 Thread Igor Vaynberg
here is a download link that doesnt block. notice that unlike the original
it has no security - it's urls are stable and it will stream any file off
your harddrisk. you can use it as a starting point to build a download link
suited for your app.

-igor


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the License); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.wicket.markup.html.link;

import java.io.File;

import org.apache.wicket.Resource;
import org.apache.wicket.ResourceReference;
import org.apache.wicket.Response;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.protocol.http.WebResponse;
import org.apache.wicket.util.resource.FileResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.value.ValueMap;


/**
 * @author Igor Vaynberg (ivaynberg)
 */
public class DownloadLink extends WebMarkupContainer
{
private static final String FILE_PARAM = file;
private static final long serialVersionUID = 1L;

public DownloadLink(String id, IModel model)
{
super(id, model);
}


protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
checkComponentTag(tag, a);
File file = (File)getModelObject();
FileResourceReference ref = new FileResourceReference();
ValueMap params = new ValueMap();
params.put(FILE_PARAM, file.getAbsolutePath());
tag.put(href, getRequestCycle().urlFor(ref, params));
}


/**
 *
 * @see org.apache.wicket.markup.html.link.Link#onClick()
 */
private static class FileResourceReference extends ResourceReference
{

public FileResourceReference()
{
super(DownloadLink.class, );
}

private static final long serialVersionUID = 1L;

protected Resource newResource()
{
return new Resource()
{
private static final long serialVersionUID = 1L;

public IResourceStream getResourceStream()
{
return new FileResourceStream(getFile());
}

protected void configureResponse(Response response)
{

((WebResponse)response).setAttachmentHeader(getFile().getName());
}

private File getFile()
{
return new File(getParameters().getString(FILE_PARAM));
}

};
}

}
}


On 8/27/07, Matej Knopp [EMAIL PROTECTED] wrote:

 The blocking is necessary in order not to corrupt session state. We have
 as
 fine grained locking as possible (under the circumstances). Web
 applications
 are by nature multi-threaded. If you don't synchronize the access to
 certain
 resources (sessions) you can get bugs that are very difficult to trace.

 If you need download link, there are alternatives that don't block such as
 shared resource.

 -Matej

 On 8/27/07, Thomas Singer [EMAIL PROTECTED] wrote:
 
   I think the email address is quite obvious.
 
  I'm talking about real addresses. But as Eelco already stated, it might
 be
  hard to list them because you are scattered over the world. I'll accept
  that.
 
   Ever heard of open source?  Just think about it a little. You have a
  product
   that a group of people spend lot of time developing and they are
 giving
  it
   to you for free.
 
  Sure, I know the advantages (and disadvantages) of Open Source. I thank
  you
  for making Wicket freely available and try to spread good words about it
  (if
  possible).
 
   So now just because your problem haven't been fixed in 10
   hours, you feel sick about it?
 
  No, I just feel (a little bit!) sick, that we've found such a IMHO major
  problem after having invested a couple of weeks work.
 
   It blocks only if that is a component request (it blocks on pagemap).
 If
  you
   have large files you need to use shared resources that don't block.
 Also
  the
   block is only one pagemap only (thus one session) and it lasts only
 for
  a
   minute. No need to restart tomcat server.
 
  Most likely I don't understand the reasons behind the blocking, but from
 a
  user's 

Re: DownloadLink hanging

2007-08-26 Thread Thomas Singer
BTW, as long as this issue is not fixed, we can't take our Wicket-based 
website online. This is a show-stopper bug for us. :(


--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Thomas Singer wrote:

Done: https://issues.apache.org/jira/browse/WICKET-878

Tom


Igor Vaynberg wrote:

yep

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

Should I report a bug in JIRA?

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

hm, this looks like an old bug. johan didnt we fix this a while ago?

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

inside shared
resource you can simply call Session.get() to get to wicket session.

Unfortunately, it looks like this is not possible, because I'm getting
following exception:


java.lang.IllegalStateException: you can only locate or create

sessions

in the context of a request cycle

  org.apache.wicket.Session.findOrCreate(Session.java:250)
  org.apache.wicket.Session.get(Session.java:279)
  com.syntevo.hpsmart.DownloadResource.getResourceStream(

DownloadResource.java:18)

  org.apache.wicket.protocol.http.WicketFilter.getLastModified(

WicketFilter.java:708)

  org.apache.wicket.protocol.http.WicketFilter.doFilter(

WicketFilter.java:122)

Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-24 Thread Thomas Singer

Done: https://issues.apache.org/jira/browse/WICKET-878

Tom


Igor Vaynberg wrote:

yep

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

Should I report a bug in JIRA?

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

hm, this looks like an old bug. johan didnt we fix this a while ago?

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

inside shared
resource you can simply call Session.get() to get to wicket session.

Unfortunately, it looks like this is not possible, because I'm getting
following exception:


java.lang.IllegalStateException: you can only locate or create

sessions

in the context of a request cycle

  org.apache.wicket.Session.findOrCreate(Session.java:250)
  org.apache.wicket.Session.get(Session.java:279)
  com.syntevo.hpsmart.DownloadResource.getResourceStream(

DownloadResource.java:18)

  org.apache.wicket.protocol.http.WicketFilter.getLastModified(

WicketFilter.java:708)

  org.apache.wicket.protocol.http.WicketFilter.doFilter(

WicketFilter.java:122)

Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-24 Thread Jean-Baptiste Quenot
* Igor Vaynberg:

 yep, DownloadLinks will block because  requests to the same page
 are serialized.

Igor, that's a good point.

Thomas, did  you try to  follow the  approach shown in  the static
pages examples?

See http://wicketstuff.org/wicket13/staticpages/
-- 
 Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-23 Thread Thomas Singer

inside shared
resource you can simply call Session.get() to get to wicket session.


Unfortunately, it looks like this is not possible, because I'm getting 
following exception:



java.lang.IllegalStateException: you can only locate or create sessions in the 
context of a request cycle
org.apache.wicket.Session.findOrCreate(Session.java:250)
org.apache.wicket.Session.get(Session.java:279)

com.syntevo.hpsmart.DownloadResource.getResourceStream(DownloadResource.java:18)

org.apache.wicket.protocol.http.WicketFilter.getLastModified(WicketFilter.java:708)

org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:122)


Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }


--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

you can register a shared resource and build a url for it. inside shared
resource you can simply call Session.get() to get to wicket session.

see application.getsharedresources();

alternatively you can extend WicketSessionFilter which will also allow you
to perform Session.get()


-igor


On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Disclaimer: I'm not experienced with filters or wicket resources.

Is it possible to create a (shared) wicket resource which can be
filtered,
so it only is accessible when the right flag is set in OurWebSession?

Or would you suggest to write an own javax.servlet.Filter which does this
flag-check and redirects internally to a hidden location which then is
send
to the client by Tomcat when the right flag is set?

Thanks in advance.

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi Igor,


yep, DownloadLinks will block because requests to the same page are
serialized.

Sorry, I don't understand, why links to downloadable resources should

be

blocking or serialized. Usually downloads are the larger parts of an
application and hence should never lock the application.


because this is how this component is designed to work. if you dont like

it

you can build your own that doesnt block.


to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then create

a

link component that can build a download url.

Well, I guess, we can't use a servlet, because wicket is registered to
/*, so it will get everything.


wicket is a filter, so even though it is mapped to /* it will let urls

that

are not wicket urls pass through. how do you think it lets you download
static images...
so if you map your wicket filter on /* and the servlet on /download and

yo

have no download mount in wicket the filter will let /download/*

requests

go to the servlet.

-igor


Could you please give some more hints

about shared resources? I've tried to search
http://cwiki.apache.org/WICKET/ without luck.

Alternatively, is it possible to complete shut off the serialization
(which seems to cause this and maybe even other blocking problems)?

--
Best regards
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany


Igor Vaynberg wrote:

yep, DownloadLinks will block because requests to the same page are
serialized.

to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then create

a

link component that can build a download url.

-igor


On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
DownloadLinks on a page (created with 'new DownloadPage(parameters)')

for

larger files (a couple of MB). I open different tabs of the same page

in

Opera and click these download links, so the downloads should happen

in

parallel. Unfortunately, the web-application seems to hang until the
previous files were completely downloaded. Even normal pages do not

show

up.

This does not happen for other websites (so our internet connection
couldn't
be the reason) and not for the same project with
old-JSP-/Servlet-technology
at a different server running in the same version of Tomcat.

Is this a known problem? How to work around?

--
Best regards,
Thomas Singer
_
SyyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-23 Thread Thomas Singer

Should I report a bug in JIRA?

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

hm, this looks like an old bug. johan didnt we fix this a while ago?

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

inside shared
resource you can simply call Session.get() to get to wicket session.

Unfortunately, it looks like this is not possible, because I'm getting
following exception:


java.lang.IllegalStateException: you can only locate or create sessions

in the context of a request cycle

  org.apache.wicket.Session.findOrCreate(Session.java:250)
  org.apache.wicket.Session.get(Session.java:279)
  com.syntevo.hpsmart.DownloadResource.getResourceStream(

DownloadResource.java:18)

  org.apache.wicket.protocol.http.WicketFilter.getLastModified(

WicketFilter.java:708)

  org.apache.wicket.protocol.http.WicketFilter.doFilter(

WicketFilter.java:122)

Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

you can register a shared resource and build a url for it. inside shared
resource you can simply call Session.get() to get to wicket session.

see application.getsharedresources();

alternatively you can extend WicketSessionFilter which will also allow

you

to perform Session.get()


-igor


On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Disclaimer: I'm not experienced with filters or wicket resources.

Is it possible to create a (shared) wicket resource which can be
filtered,
so it only is accessible when the right flag is set in OurWebSession?

Or would you suggest to write an own javax.servlet.Filter which does

this

flag-check and redirects internally to a hidden location which then is
send
to the client by Tomcat when the right flag is set?

Thanks in advance.

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi Igor,


yep, DownloadLinks will block because requests to the same page are
serialized.

Sorry, I don't understand, why links to downloadable resources should

be

blocking or serialized. Usually downloads are the larger parts of an
application and hence should never lock the application.

because this is how this component is designed to work. if you dont

like

it

you can build your own that doesnt block.


to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then

create

a

link component that can build a download url.

Well, I guess, we can't use a servlet, because wicket is registered

to

/*, so it will get everything.

wicket is a filter, so even though it is mapped to /* it will let urls

that

are not wicket urls pass through. how do you think it lets you

download

static images...
so if you map your wicket filter on /* and the servlet on /download

and

yo

have no download mount in wicket the filter will let /download/*

requests

go to the servlet.

-igor


Could you please give some more hints

about shared resources? I've tried to search
http://cwiki.apache.org/WICKET/ without luck.

Alternatively, is it possible to complete shut off the serialization
(which seems to cause this and maybe even other blocking problems)?

--
Best regards
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany


Igor Vaynberg wrote:

yep, DownloadLinks will block because requests to the same page are
serialized.

to work around it register a shared resource or create a servlet

that

can

stream the file (resoureces in wicket are not serialized), then

create

a

link component that can build a download url.

-igor


On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple

of

DownloadLinks on a page (created with 'new

DownloadPage(parameters)')

for

larger files (a couple of MB). I open different tabs of the same

page

in

Opera and click these download links, so the downloads should

happen

in

parallel. Unfortunately, the web-application seems to hang until

the

previous files were completely downloaded. Even normal pages do not

show

up.

This does not happen for other websites (so our internet connection
couldn't
be the reason) and not for the same project with
old-JSP-/Servlet-technology
at a different server running in the same version of Tomcat.

Is this a known problem? How to work around?

--
Best regards,

Re: DownloadLink hanging

2007-08-23 Thread Igor Vaynberg
yep

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

 Should I report a bug in JIRA?

 --
 Best regards,
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany
 www.syntevo.com


 Igor Vaynberg wrote:
  hm, this looks like an old bug. johan didnt we fix this a while ago?
 
  -igor
 
 
  On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:
  inside shared
  resource you can simply call Session.get() to get to wicket session.
  Unfortunately, it looks like this is not possible, because I'm getting
  following exception:
 
  java.lang.IllegalStateException: you can only locate or create
 sessions
  in the context of a request cycle
org.apache.wicket.Session.findOrCreate(Session.java:250)
org.apache.wicket.Session.get(Session.java:279)
com.syntevo.hpsmart.DownloadResource.getResourceStream(
  DownloadResource.java:18)
org.apache.wicket.protocol.http.WicketFilter.getLastModified(
  WicketFilter.java:708)
org.apache.wicket.protocol.http.WicketFilter.doFilter(
  WicketFilter.java:122)
 
  Our resource code looks like this:
 
  final class DownloadResource extends Resource {
 
public IResourceStream getResourceStream() {
  final OurSession session = (OurSession)Session.get();
  if (session == null) {
return null;
  }
 
  final File file = session.getFileToDownload();
  if (file == null) {
return null;
  }
 
  return new MyFileResourceStream(file);
}
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Igor Vaynberg wrote:
  you can register a shared resource and build a url for it. inside
 shared
  resource you can simply call Session.get() to get to wicket session.
 
  see application.getsharedresources();
 
  alternatively you can extend WicketSessionFilter which will also allow
  you
  to perform Session.get()
 
 
  -igor
 
 
  On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Disclaimer: I'm not experienced with filters or wicket resources.
 
  Is it possible to create a (shared) wicket resource which can be
  filtered,
  so it only is accessible when the right flag is set in OurWebSession?
 
  Or would you suggest to write an own javax.servlet.Filter which does
  this
  flag-check and redirects internally to a hidden location which then
 is
  send
  to the client by Tomcat when the right flag is set?
 
  Thanks in advance.
 
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Igor Vaynberg wrote:
  On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi Igor,
 
  yep, DownloadLinks will block because requests to the same page
 are
  serialized.
  Sorry, I don't understand, why links to downloadable resources
 should
  be
  blocking or serialized. Usually downloads are the larger parts of
 an
  application and hence should never lock the application.
  because this is how this component is designed to work. if you dont
  like
  it
  you can build your own that doesnt block.
 
  to work around it register a shared resource or create a servlet
 that
  can
  stream the file (resoureces in wicket are not serialized), then
  create
  a
  link component that can build a download url.
  Well, I guess, we can't use a servlet, because wicket is registered
  to
  /*, so it will get everything.
  wicket is a filter, so even though it is mapped to /* it will let
 urls
  that
  are not wicket urls pass through. how do you think it lets you
  download
  static images...
  so if you map your wicket filter on /* and the servlet on /download
  and
  yo
  have no download mount in wicket the filter will let /download/*
  requests
  go to the servlet.
 
  -igor
 
 
  Could you please give some more hints
  about shared resources? I've tried to search
  http://cwiki.apache.org/WICKET/ without luck.
 
  Alternatively, is it possible to complete shut off the
 serialization
  (which seems to cause this and maybe even other blocking problems)?
 
  --
  Best regards
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
 
 
  Igor Vaynberg wrote:
  yep, DownloadLinks will block because requests to the same page
 are
  serialized.
 
  to work around it register a shared resource or create a servlet
  that
  can
  stream the file (resoureces in wicket are not serialized), then
  create
  a
  link component that can build a download url.
 
  -igor
 
 
  On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi,
 
  We are using Wicket 1.3 beta 2 running in Tomcat and have a
 couple
  of
  DownloadLinks on a page (created with 'new
  DownloadPage(parameters)')
  for
  larger files (a couple of MB). I open different tabs of the same
  page
  in
  Opera and click these download links, so the downloads should
  happen
  in
  parallel. Unfortunately, the web-application seems to hang until
  the
  previous files were 

Re: DownloadLink hanging

2007-08-22 Thread Igor Vaynberg
you can register a shared resource and build a url for it. inside shared
resource you can simply call Session.get() to get to wicket session.

see application.getsharedresources();

alternatively you can extend WicketSessionFilter which will also allow you
to perform Session.get()


-igor


On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

 Disclaimer: I'm not experienced with filters or wicket resources.

 Is it possible to create a (shared) wicket resource which can be
 filtered,
 so it only is accessible when the right flag is set in OurWebSession?

 Or would you suggest to write an own javax.servlet.Filter which does this
 flag-check and redirects internally to a hidden location which then is
 send
 to the client by Tomcat when the right flag is set?

 Thanks in advance.

 --
 Best regards,
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany
 www.syntevo.com


 Igor Vaynberg wrote:
  On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi Igor,
 
  yep, DownloadLinks will block because requests to the same page are
  serialized.
  Sorry, I don't understand, why links to downloadable resources should
 be
  blocking or serialized. Usually downloads are the larger parts of an
  application and hence should never lock the application.
 
 
  because this is how this component is designed to work. if you dont like
 it
  you can build your own that doesnt block.
 
  to work around it register a shared resource or create a servlet that
 can
  stream the file (resoureces in wicket are not serialized), then create
 a
  link component that can build a download url.
  Well, I guess, we can't use a servlet, because wicket is registered to
  /*, so it will get everything.
 
 
  wicket is a filter, so even though it is mapped to /* it will let urls
 that
  are not wicket urls pass through. how do you think it lets you download
  static images...
  so if you map your wicket filter on /* and the servlet on /download and
 yo
  have no download mount in wicket the filter will let /download/*
 requests
  go to the servlet.
 
  -igor
 
 
  Could you please give some more hints
  about shared resources? I've tried to search
  http://cwiki.apache.org/WICKET/ without luck.
 
  Alternatively, is it possible to complete shut off the serialization
  (which seems to cause this and maybe even other blocking problems)?
 
  --
  Best regards
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
 
 
  Igor Vaynberg wrote:
  yep, DownloadLinks will block because requests to the same page are
  serialized.
 
  to work around it register a shared resource or create a servlet that
  can
  stream the file (resoureces in wicket are not serialized), then create
 a
  link component that can build a download url.
 
  -igor
 
 
  On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi,
 
  We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
  DownloadLinks on a page (created with 'new DownloadPage(parameters)')
  for
  larger files (a couple of MB). I open different tabs of the same page
  in
  Opera and click these download links, so the downloads should happen
 in
  parallel. Unfortunately, the web-application seems to hang until the
  previous files were completely downloaded. Even normal pages do not
  show
  up.
 
  This does not happen for other websites (so our internet connection
  couldn't
  be the reason) and not for the same project with
  old-JSP-/Servlet-technology
  at a different server running in the same version of Tomcat.
 
  Is this a known problem? How to work around?
 
  --
  Best regards,
  Thomas Singer
  _
  SyyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-21 Thread Igor Vaynberg
On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

 Hi Igor,

  yep, DownloadLinks will block because requests to the same page are
  serialized.

 Sorry, I don't understand, why links to downloadable resources should be
 blocking or serialized. Usually downloads are the larger parts of an
 application and hence should never lock the application.


because this is how this component is designed to work. if you dont like it
you can build your own that doesnt block.

 to work around it register a shared resource or create a servlet that can
  stream the file (resoureces in wicket are not serialized), then create a
  link component that can build a download url.

 Well, I guess, we can't use a servlet, because wicket is registered to
 /*, so it will get everything.


wicket is a filter, so even though it is mapped to /* it will let urls that
are not wicket urls pass through. how do you think it lets you download
static images...
so if you map your wicket filter on /* and the servlet on /download and yo
have no download mount in wicket the filter will let /download/* requests
go to the servlet.

-igor


Could you please give some more hints
 about shared resources? I've tried to search
 http://cwiki.apache.org/WICKET/ without luck.

 Alternatively, is it possible to complete shut off the serialization
 (which seems to cause this and maybe even other blocking problems)?

 --
 Best regards
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany


 Igor Vaynberg wrote:
  yep, DownloadLinks will block because requests to the same page are
  serialized.
 
  to work around it register a shared resource or create a servlet that
 can
  stream the file (resoureces in wicket are not serialized), then create a
  link component that can build a download url.
 
  -igor
 
 
  On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi,
 
  We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
  DownloadLinks on a page (created with 'new DownloadPage(parameters)')
 for
  larger files (a couple of MB). I open different tabs of the same page
 in
  Opera and click these download links, so the downloads should happen in
  parallel. Unfortunately, the web-application seems to hang until the
  previous files were completely downloaded. Even normal pages do not
 show
  up.
 
  This does not happen for other websites (so our internet connection
  couldn't
  be the reason) and not for the same project with
  old-JSP-/Servlet-technology
  at a different server running in the same version of Tomcat.
 
  Is this a known problem? How to work around?
 
  --
  Best regards,
  Thomas Singer
  _
  SyyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-21 Thread Thomas Singer

Disclaimer: I'm not experienced with filters or wicket resources.

Is it possible to create a (shared) wicket resource which can be filtered, 
so it only is accessible when the right flag is set in OurWebSession?


Or would you suggest to write an own javax.servlet.Filter which does this 
flag-check and redirects internally to a hidden location which then is send 
to the client by Tomcat when the right flag is set?


Thanks in advance.

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi Igor,


yep, DownloadLinks will block because requests to the same page are
serialized.

Sorry, I don't understand, why links to downloadable resources should be
blocking or serialized. Usually downloads are the larger parts of an
application and hence should never lock the application.



because this is how this component is designed to work. if you dont like it
you can build your own that doesnt block.


to work around it register a shared resource or create a servlet that can

stream the file (resoureces in wicket are not serialized), then create a
link component that can build a download url.

Well, I guess, we can't use a servlet, because wicket is registered to
/*, so it will get everything.



wicket is a filter, so even though it is mapped to /* it will let urls that
are not wicket urls pass through. how do you think it lets you download
static images...
so if you map your wicket filter on /* and the servlet on /download and yo
have no download mount in wicket the filter will let /download/* requests
go to the servlet.

-igor


Could you please give some more hints

about shared resources? I've tried to search
http://cwiki.apache.org/WICKET/ without luck.

Alternatively, is it possible to complete shut off the serialization
(which seems to cause this and maybe even other blocking problems)?

--
Best regards
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany


Igor Vaynberg wrote:

yep, DownloadLinks will block because requests to the same page are
serialized.

to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then create a
link component that can build a download url.

-igor


On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
DownloadLinks on a page (created with 'new DownloadPage(parameters)')

for

larger files (a couple of MB). I open different tabs of the same page

in

Opera and click these download links, so the downloads should happen in
parallel. Unfortunately, the web-application seems to hang until the
previous files were completely downloaded. Even normal pages do not

show

up.

This does not happen for other websites (so our internet connection
couldn't
be the reason) and not for the same project with
old-JSP-/Servlet-technology
at a different server running in the same version of Tomcat.

Is this a known problem? How to work around?

--
Best regards,
Thomas Singer
_
SyyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DownloadLink hanging

2007-08-20 Thread Thomas Singer

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of 
DownloadLinks on a page (created with 'new DownloadPage(parameters)') for 
larger files (a couple of MB). I open different tabs of the same page in 
Opera and click these download links, so the downloads should happen in 
parallel. Unfortunately, the web-application seems to hang until the 
previous files were completely downloaded. Even normal pages do not show up.


This does not happen for other websites (so our internet connection couldn't 
be the reason) and not for the same project with old-JSP-/Servlet-technology 
at a different server running in the same version of Tomcat.


Is this a known problem? How to work around?

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]