You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Dukaczewski <m....@tu-bs.de> on 2010/09/15 11:22:36 UTC

[T5.2] Tapestry IoC Configuration (remove?)

How can I remove something from the distributed configuration? For
example there is a default:

contributeResponseCompressionAnalyzer(Configuration<String> configuration) {
    configuration.add("application/json");
}

I am missing something like:

contributeResponseCompressionAnalyzer(Configuration<String> configuration) {
    configuration.remove("application/json");
}


Regards,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Massimo Lusetti <ml...@gmail.com>.
On Thu, Sep 16, 2010 at 4:50 PM, Michael Dukaczewski
<m....@tu-bs.de> wrote:

> I know. I have been following the topic. But now I have the problem that
> I have to transfer very large JSON objects. The application on which I
> am working is just for a small group of people (intranet) where I can
> make browser decisions. With luck, I can find a configuration that works
> well in my case with gzip compression. So is there a way to reactivate it?

There's no knob to push or pull, but you still have the code...

Cheers
-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've been looking at the code, and I noticed that (for some reason)
the code for streaming a JSONObject invokes PrintWriter.flush() at the
end.  The code for streaming a partial page render response (which is
also JSON) invokes PrintWriter.close().  I believe the later is
correct. It is possible that flush() does not truly flush and that the
end of the gzip stream never gets sent to the client, causing
problems.

I'm trying to figure out how to test this hypothesis, but I'm not sure
how to get the current code to fail under test conditions.

On Fri, Sep 17, 2010 at 3:59 AM, Michael Dukaczewski
<m....@tu-bs.de> wrote:
> Hi Howard and all,
>
> thanks for your reply. I am always impressed how flexible Tapestry is.
> The activation of the compression for JSON worked, but I was struck
> by TAP5-469 and started some research.
> Regarding your blog post
> (http://tapestryjava.blogspot.com/2009/04/is-gzip-compression-compatible-with.html):
> I tried several other combinations that worked fine, so I'm convinced
> that GZIP compression in combination with JSON content basically works.
> Thus, the error seems to be somewhere in the Tapestry code. My research
> has shown that the Tapestry gzip stream sometimes does not finish
> correctly when sending json. Therefore, the data is broken when it
> arrives at the client. I have now solved the problem the following way
> and it works very well:
>
> I have changed my event handler from:
>
> JSONObject onAction() {return getJson();}
>
> to:
>
> StreamResponse onAction() {return new JSONResponse(getJson());}
>
> and created the following wrapper:
>
> public class JSONResponse implements StreamResponse {
>
>       private static final int HEADER_SIZE = 20;
>       private static final int MIN_DATA_SIZE = 512;
>       private static final String CHARSET = "UTF-8";
>
>       private byte[] data;
>       private boolean compress;
>
>       public JSONResponse(JSONCollection json) {
>               try {
>                       data = json.toCompactString().getBytes(CHARSET);
>                       compress = data.length >= MIN_DATA_SIZE;
>               } catch (UnsupportedEncodingException e) {
>                       // should never happen!
>               }
>       }
>
>       @Override
>       public String getContentType() {
>               return "application/json; charset="+CHARSET;
>       }
>
>       @Override
>       public InputStream getStream() throws IOException {
>               if (!compress) {
>                       return new ByteArrayInputStream(data);
>               }
>               ByteArrayOutputStream out = new ByteArrayOutputStream(
>                        expectedCompressedSize(data.length));
>               GZIPOutputStream gzip = new GZIPOutputStream(out);
>               gzip.write(data);
>               gzip.close();
>               byte[] gzipedData = out.toByteArray();
>               return new ByteArrayInputStream(gzipedData);
>       }
>
>       @Override
>       public void prepareResponse(Response response) {
>               if (compress) {
>                       response.setHeader("Content-Encoding", "gzip");
>               }
>       }
>
>       private int expectedCompressedSize(int size) {
>               return (size >> 2) + HEADER_SIZE;
>       }
>
> }
>
>
> Regards,
> Michael
>
>
>
> Am 16.09.2010 18:03, schrieb Howard Lewis Ship:
>> Also, make sure you disable JSON pretty printing!  Most of a JSON
>> response is now whitespace when in development mode.
>>
>> On Thu, Sep 16, 2010 at 8:59 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
>>> It's a bit kludgey, but you could decorate the
>>> ResponseCompressionAnalyzer service, something like:
>>>
>>> public ResponseCompressionAnalyzer
>>> decorateResonseCompressionAnalyzer(final ResponseCompressionAnalyzer
>>> delegate)
>>> {
>>>  return new REsponseCompressionAnalyzer() {
>>>    public boolean isGzipSupported() { return delegate.isGzipSupported(); }
>>>  public     boolean isCompressable(String contentType) {
>>>    if (contentType.equals("application/json")) return true;
>>>
>>> return delegate.isCompressable(contentType);
>>> }
>>> };
>>>
>>> }
>>>
>>> On Thu, Sep 16, 2010 at 7:50 AM, Michael Dukaczewski
>>> <m....@tu-bs.de> wrote:
>>>> I know. I have been following the topic. But now I have the problem that
>>>> I have to transfer very large JSON objects. The application on which I
>>>> am working is just for a small group of people (intranet) where I can
>>>> make browser decisions. With luck, I can find a configuration that works
>>>> well in my case with gzip compression. So is there a way to reactivate it?
>>>>
>>>>
>>>> Am 16.09.2010 16:12, schrieb Thiago H. de Paula Figueiredo:
>>>>> On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski
>>>>> <m....@tu-bs.de> wrote:
>>>>>
>>>>>> thanks for your answer, but that does not help me.
>>>>>> Is there a simple workaround to reactivate gzip compression for json?
>>>>>
>>>>> It was disabled because it cause problems in some browsers.
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Howard M. Lewis Ship
>>>
>>> Creator of Apache Tapestry
>>>
>>> The source for Tapestry training, mentoring and support. Contact me to
>>> learn how I can get you up and productive in Tapestry fast!
>>>
>>> (971) 678-5210
>>> http://howardlewisship.com
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've been looking at the code, and I noticed that (for some reason)
the code for streaming a JSONObject invokes PrintWriter.flush() at the
end.  The code for streaming a partial page render response (which is
also JSON) invokes PrintWriter.close().  I believe the later is
correct. It is possible that flush() does not truly flush and that the
end of the gzip stream never gets sent to the client, causing
problems.

I'm trying to figure out how to test this hypothesis, but I'm not sure
how to get the current code to fail under test conditions.

On Fri, Sep 17, 2010 at 3:59 AM, Michael Dukaczewski
<m....@tu-bs.de> wrote:
> Hi Howard and all,
>
> thanks for your reply. I am always impressed how flexible Tapestry is.
> The activation of the compression for JSON worked, but I was struck
> by TAP5-469 and started some research.
> Regarding your blog post
> (http://tapestryjava.blogspot.com/2009/04/is-gzip-compression-compatible-with.html):
> I tried several other combinations that worked fine, so I'm convinced
> that GZIP compression in combination with JSON content basically works.
> Thus, the error seems to be somewhere in the Tapestry code. My research
> has shown that the Tapestry gzip stream sometimes does not finish
> correctly when sending json. Therefore, the data is broken when it
> arrives at the client. I have now solved the problem the following way
> and it works very well:
>
> I have changed my event handler from:
>
> JSONObject onAction() {return getJson();}
>
> to:
>
> StreamResponse onAction() {return new JSONResponse(getJson());}
>
> and created the following wrapper:
>
> public class JSONResponse implements StreamResponse {
>
>       private static final int HEADER_SIZE = 20;
>       private static final int MIN_DATA_SIZE = 512;
>       private static final String CHARSET = "UTF-8";
>
>       private byte[] data;
>       private boolean compress;
>
>       public JSONResponse(JSONCollection json) {
>               try {
>                       data = json.toCompactString().getBytes(CHARSET);
>                       compress = data.length >= MIN_DATA_SIZE;
>               } catch (UnsupportedEncodingException e) {
>                       // should never happen!
>               }
>       }
>
>       @Override
>       public String getContentType() {
>               return "application/json; charset="+CHARSET;
>       }
>
>       @Override
>       public InputStream getStream() throws IOException {
>               if (!compress) {
>                       return new ByteArrayInputStream(data);
>               }
>               ByteArrayOutputStream out = new ByteArrayOutputStream(
>                        expectedCompressedSize(data.length));
>               GZIPOutputStream gzip = new GZIPOutputStream(out);
>               gzip.write(data);
>               gzip.close();
>               byte[] gzipedData = out.toByteArray();
>               return new ByteArrayInputStream(gzipedData);
>       }
>
>       @Override
>       public void prepareResponse(Response response) {
>               if (compress) {
>                       response.setHeader("Content-Encoding", "gzip");
>               }
>       }
>
>       private int expectedCompressedSize(int size) {
>               return (size >> 2) + HEADER_SIZE;
>       }
>
> }
>
>
> Regards,
> Michael
>
>
>
> Am 16.09.2010 18:03, schrieb Howard Lewis Ship:
>> Also, make sure you disable JSON pretty printing!  Most of a JSON
>> response is now whitespace when in development mode.
>>
>> On Thu, Sep 16, 2010 at 8:59 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
>>> It's a bit kludgey, but you could decorate the
>>> ResponseCompressionAnalyzer service, something like:
>>>
>>> public ResponseCompressionAnalyzer
>>> decorateResonseCompressionAnalyzer(final ResponseCompressionAnalyzer
>>> delegate)
>>> {
>>>  return new REsponseCompressionAnalyzer() {
>>>    public boolean isGzipSupported() { return delegate.isGzipSupported(); }
>>>  public     boolean isCompressable(String contentType) {
>>>    if (contentType.equals("application/json")) return true;
>>>
>>> return delegate.isCompressable(contentType);
>>> }
>>> };
>>>
>>> }
>>>
>>> On Thu, Sep 16, 2010 at 7:50 AM, Michael Dukaczewski
>>> <m....@tu-bs.de> wrote:
>>>> I know. I have been following the topic. But now I have the problem that
>>>> I have to transfer very large JSON objects. The application on which I
>>>> am working is just for a small group of people (intranet) where I can
>>>> make browser decisions. With luck, I can find a configuration that works
>>>> well in my case with gzip compression. So is there a way to reactivate it?
>>>>
>>>>
>>>> Am 16.09.2010 16:12, schrieb Thiago H. de Paula Figueiredo:
>>>>> On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski
>>>>> <m....@tu-bs.de> wrote:
>>>>>
>>>>>> thanks for your answer, but that does not help me.
>>>>>> Is there a simple workaround to reactivate gzip compression for json?
>>>>>
>>>>> It was disabled because it cause problems in some browsers.
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Howard M. Lewis Ship
>>>
>>> Creator of Apache Tapestry
>>>
>>> The source for Tapestry training, mentoring and support. Contact me to
>>> learn how I can get you up and productive in Tapestry fast!
>>>
>>> (971) 678-5210
>>> http://howardlewisship.com
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Michael Dukaczewski <m....@tu-bs.de>.
Hi Howard and all,

thanks for your reply. I am always impressed how flexible Tapestry is.
The activation of the compression for JSON worked, but I was struck
by TAP5-469 and started some research.
Regarding your blog post
(http://tapestryjava.blogspot.com/2009/04/is-gzip-compression-compatible-with.html):
I tried several other combinations that worked fine, so I'm convinced
that GZIP compression in combination with JSON content basically works.
Thus, the error seems to be somewhere in the Tapestry code. My research
has shown that the Tapestry gzip stream sometimes does not finish
correctly when sending json. Therefore, the data is broken when it
arrives at the client. I have now solved the problem the following way
and it works very well:

I have changed my event handler from:

JSONObject onAction() {return getJson();}

to:

StreamResponse onAction() {return new JSONResponse(getJson());}

and created the following wrapper:

public class JSONResponse implements StreamResponse {

       private static final int HEADER_SIZE = 20;
       private static final int MIN_DATA_SIZE = 512;
       private static final String CHARSET = "UTF-8";

       private byte[] data;
       private boolean compress;

       public JSONResponse(JSONCollection json) {
               try {
                       data = json.toCompactString().getBytes(CHARSET);
                       compress = data.length >= MIN_DATA_SIZE;
               } catch (UnsupportedEncodingException e) {
                       // should never happen!
               }
       }

       @Override
       public String getContentType() {
               return "application/json; charset="+CHARSET;
       }

       @Override
       public InputStream getStream() throws IOException {
               if (!compress) {
                       return new ByteArrayInputStream(data);
               }
               ByteArrayOutputStream out = new ByteArrayOutputStream(
			expectedCompressedSize(data.length));
               GZIPOutputStream gzip = new GZIPOutputStream(out);
               gzip.write(data);
               gzip.close();
               byte[] gzipedData = out.toByteArray();
               return new ByteArrayInputStream(gzipedData);
       }

       @Override
       public void prepareResponse(Response response) {
               if (compress) {
                       response.setHeader("Content-Encoding", "gzip");
               }
       }

       private int expectedCompressedSize(int size) {
               return (size >> 2) + HEADER_SIZE;
       }

}


Regards,
Michael



Am 16.09.2010 18:03, schrieb Howard Lewis Ship:
> Also, make sure you disable JSON pretty printing!  Most of a JSON
> response is now whitespace when in development mode.
> 
> On Thu, Sep 16, 2010 at 8:59 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
>> It's a bit kludgey, but you could decorate the
>> ResponseCompressionAnalyzer service, something like:
>>
>> public ResponseCompressionAnalyzer
>> decorateResonseCompressionAnalyzer(final ResponseCompressionAnalyzer
>> delegate)
>> {
>>  return new REsponseCompressionAnalyzer() {
>>    public boolean isGzipSupported() { return delegate.isGzipSupported(); }
>>  public     boolean isCompressable(String contentType) {
>>    if (contentType.equals("application/json")) return true;
>>
>> return delegate.isCompressable(contentType);
>> }
>> };
>>
>> }
>>
>> On Thu, Sep 16, 2010 at 7:50 AM, Michael Dukaczewski
>> <m....@tu-bs.de> wrote:
>>> I know. I have been following the topic. But now I have the problem that
>>> I have to transfer very large JSON objects. The application on which I
>>> am working is just for a small group of people (intranet) where I can
>>> make browser decisions. With luck, I can find a configuration that works
>>> well in my case with gzip compression. So is there a way to reactivate it?
>>>
>>>
>>> Am 16.09.2010 16:12, schrieb Thiago H. de Paula Figueiredo:
>>>> On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski
>>>> <m....@tu-bs.de> wrote:
>>>>
>>>>> thanks for your answer, but that does not help me.
>>>>> Is there a simple workaround to reactivate gzip compression for json?
>>>>
>>>> It was disabled because it cause problems in some browsers.
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Howard Lewis Ship <hl...@gmail.com>.
Also, make sure you disable JSON pretty printing!  Most of a JSON
response is now whitespace when in development mode.

On Thu, Sep 16, 2010 at 8:59 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> It's a bit kludgey, but you could decorate the
> ResponseCompressionAnalyzer service, something like:
>
> public ResponseCompressionAnalyzer
> decorateResonseCompressionAnalyzer(final ResponseCompressionAnalyzer
> delegate)
> {
>  return new REsponseCompressionAnalyzer() {
>    public boolean isGzipSupported() { return delegate.isGzipSupported(); }
>  public     boolean isCompressable(String contentType) {
>    if (contentType.equals("application/json")) return true;
>
> return delegate.isCompressable(contentType);
> }
> };
>
> }
>
> On Thu, Sep 16, 2010 at 7:50 AM, Michael Dukaczewski
> <m....@tu-bs.de> wrote:
>> I know. I have been following the topic. But now I have the problem that
>> I have to transfer very large JSON objects. The application on which I
>> am working is just for a small group of people (intranet) where I can
>> make browser decisions. With luck, I can find a configuration that works
>> well in my case with gzip compression. So is there a way to reactivate it?
>>
>>
>> Am 16.09.2010 16:12, schrieb Thiago H. de Paula Figueiredo:
>>> On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski
>>> <m....@tu-bs.de> wrote:
>>>
>>>> thanks for your answer, but that does not help me.
>>>> Is there a simple workaround to reactivate gzip compression for json?
>>>
>>> It was disabled because it cause problems in some browsers.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Fwd: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Howard Lewis Ship <hl...@gmail.com>.
It's a bit kludgey, but you could decorate the
ResponseCompressionAnalyzer service, something like:

public ResponseCompressionAnalyzer
decorateResonseCompressionAnalyzer(final ResponseCompressionAnalyzer
delegate)
{
  return new REsponseCompressionAnalyzer() {
    public boolean isGzipSupported() { return delegate.isGzipSupported(); }
  public     boolean isCompressable(String contentType) {
    if (contentType.equals("application/json")) return true;

return delegate.isCompressable(contentType);
}
};

}

On Thu, Sep 16, 2010 at 7:50 AM, Michael Dukaczewski
<m....@tu-bs.de> wrote:
> I know. I have been following the topic. But now I have the problem that
> I have to transfer very large JSON objects. The application on which I
> am working is just for a small group of people (intranet) where I can
> make browser decisions. With luck, I can find a configuration that works
> well in my case with gzip compression. So is there a way to reactivate it?
>
>
> Am 16.09.2010 16:12, schrieb Thiago H. de Paula Figueiredo:
>> On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski
>> <m....@tu-bs.de> wrote:
>>
>>> thanks for your answer, but that does not help me.
>>> Is there a simple workaround to reactivate gzip compression for json?
>>
>> It was disabled because it cause problems in some browsers.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Michael Dukaczewski <m....@tu-bs.de>.
I know. I have been following the topic. But now I have the problem that
I have to transfer very large JSON objects. The application on which I
am working is just for a small group of people (intranet) where I can
make browser decisions. With luck, I can find a configuration that works
well in my case with gzip compression. So is there a way to reactivate it?


Am 16.09.2010 16:12, schrieb Thiago H. de Paula Figueiredo:
> On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski
> <m....@tu-bs.de> wrote:
> 
>> thanks for your answer, but that does not help me.
>> Is there a simple workaround to reactivate gzip compression for json?
> 
> It was disabled because it cause problems in some browsers.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 16 Sep 2010 10:40:08 -0300, Michael Dukaczewski  
<m....@tu-bs.de> wrote:

> thanks for your answer, but that does not help me.
> Is there a simple workaround to reactivate gzip compression for json?

It was disabled because it cause problems in some browsers.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Michael Dukaczewski <m....@tu-bs.de>.
Hi Kris,

thanks for your answer, but that does not help me.
Is there a simple workaround to reactivate gzip compression for json?

Regards,
Michael



Am 15.09.2010 11:32, schrieb Kristian Marinkovic:
> hi Michael,
> 
> there is no such method. Only MappedConfiguration and OrderedConfiguration 
> have an override method that can be used to replace another contribution 
> identified by the id
> 
> g,
> kris
> 
> 
> 
> 
> Von:    Michael Dukaczewski <m....@tu-bs.de>
> An:     users@tapestry.apache.org
> Datum:  15.09.2010 11:23
> Betreff:        [T5.2] Tapestry IoC Configuration (remove?)
> 
> 
> 
> How can I remove something from the distributed configuration? For
> example there is a default:
> 
> contributeResponseCompressionAnalyzer(Configuration<String> configuration) 
> {
>     configuration.add("application/json");
> }
> 
> I am missing something like:
> 
> contributeResponseCompressionAnalyzer(Configuration<String> configuration) 
> {
>     configuration.remove("application/json");
> }
> 
> 
> Regards,
> Michael
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.2] Tapestry IoC Configuration (remove?)

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi Michael,

there is no such method. Only MappedConfiguration and OrderedConfiguration 
have an override method that can be used to replace another contribution 
identified by the id

g,
kris




Von:    Michael Dukaczewski <m....@tu-bs.de>
An:     users@tapestry.apache.org
Datum:  15.09.2010 11:23
Betreff:        [T5.2] Tapestry IoC Configuration (remove?)



How can I remove something from the distributed configuration? For
example there is a default:

contributeResponseCompressionAnalyzer(Configuration<String> configuration) 
{
    configuration.add("application/json");
}

I am missing something like:

contributeResponseCompressionAnalyzer(Configuration<String> configuration) 
{
    configuration.remove("application/json");
}


Regards,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org