Re: CompressionAnalyzerImpl exception

2014-12-15 Thread Kalle Korhonen
On Mon, Dec 15, 2014 at 12:35 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:
>
> On Mon, 15 Dec 2014 12:05:52 -0200, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>> Howard, you were correct. the MIME type was null. CompressionAnalyzerImpl
>> was failing on line 32 do to contentType being null. As you stated, this
>> NPE is a failure and should probably be checked and thrown with a proper
>> message. I ended up having to override the service in order to resolve the
>> issue.
>> https://github.com/apache/tapestry-5/blob/90766995f59048cb7f7d4cf042a21a
>> 9d728583db/tapestry-core/src/main/java/org/apache/
>> tapestry5/internal/services/assets/CompressionAnalyzerImpl.java
>>
>
> That's a bug and I'll fix it. JIRA please? :)
>

While the root cause for the contentType being null is somewhere else,
CompressionAnalyzerImpl should probably just return false on null
contentType rather than throw an exception.

Kalle


>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Returning json when request is non xhr

2014-12-15 Thread Thiago H de Paula Figueiredo
On Mon, 15 Dec 2014 13:16:48 -0200, Nathan Quirynen  
 wrote:



Hi,


Hi!



I have 2 applications (different servers):
1) html + js
2) Tapestry5

Now I tried to do an ajax request (jquery) from application 1 to
application 2 where I want to return some json back to application 1.
But because cross domain get requests do not use XHR I get following
error in application 2:

Return type org.apache.tapestry5.json.JSONObject can not be handled.

So how can I return json if the request is not XHR ?


Just wrap the JsonObject or JsonArray in a StreamResponse when the request  
isn't AJAX:


if (request.isXHR()) {
return jsonObject;
else {
return new TextStreamResponse("application/json", 
jsonObject.toString());
}

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: CompressionAnalyzerImpl exception

2014-12-15 Thread Thiago H de Paula Figueiredo
On Mon, 15 Dec 2014 12:05:52 -0200, George Christman  
 wrote:



Howard, you were correct. the MIME type was null. CompressionAnalyzerImpl
was failing on line 32 do to contentType being null. As you stated, this
NPE is a failure and should probably be checked and thrown with a proper
message. I ended up having to override the service in order to resolve  
the

issue.

https://github.com/apache/tapestry-5/blob/90766995f59048cb7f7d4cf042a21a9d728583db/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java


That's a bug and I'll fix it. JIRA please? :)

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Tapestry and Clojure

2014-12-15 Thread Ilya Obshadko
On Mon, Dec 15, 2014 at 10:12 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Mon, 15 Dec 2014 17:34:10 -0200, Ilya Obshadko 
> wrote:
>
>  ServiceBuilder's buildService() receives a ServiceResources instance as a
>>> parameter. ServiceResources is an ObjectLocator (i.e. Tapestry-IoC
>>> registry).
>>>
>>
>> The wording of my question was not fully correct. tapestry-clojure
>> doesn't use ServiceBuilder, but rather its own ClojureBuilder (which does
>> the job
>> of creating service proxy and binding service interface methods to
>> Clojure> functions in a given namespace).
>>
>
> I also noticed, after sending my answer, that it wasn't very good, due to
> my lack of Clojure knowledge (yet! :)).
>
>  One way to do that is to have special interface method, bound to Clojure
>> function, which can perform necessary injection by using mutable objects
>> in Clojure code. But that doesn't look like a functional way.
>>
>
> How are Java objects usually passed to Clojure code? The recommended way?


Java objects are passed to Clojure functions in exactly the same way they
are passed to Java method (because internally Clojure function is just an
implementation of IFn interface, and function call is invoke(...) on its
instance).

But I don't want to pass services to Clojure functions, I'd like to inject
them into Clojure namespace when clojure.core/require is executed. By
itself, clojure.core/require doesn't allow passing arbitrary arguments that
might be used later inside the namespace.

So I'm not yet sure about correct way to approach this.


I would like Howard to elaborate on this topic, because I'm currently
>> researching various options and yet none of them looks quite right. But I
>> don't have much experience in Clojure, so I might be missing something
>> obvious.
>>
>
> Your suggested code hints at a Clojure function, provided by Tapestry,
> that would somehow provide access to services through the registry. I guess
> you're in the right path.




-- 
Ilya Obshadko


Re: Tapestry and Clojure

2014-12-15 Thread Thiago H de Paula Figueiredo
On Mon, 15 Dec 2014 17:34:10 -0200, Ilya Obshadko  
 wrote:


ServiceBuilder's buildService() receives a ServiceResources instance as  
a parameter. ServiceResources is an ObjectLocator (i.e. Tapestry-IoC

registry).


The wording of my question was not fully correct. tapestry-clojure  
doesn't use ServiceBuilder, but rather its own ClojureBuilder (which  
does the job
of creating service proxy and binding service interface methods to  
Clojure> functions in a given namespace).


I also noticed, after sending my answer, that it wasn't very good, due to  
my lack of Clojure knowledge (yet! :)).



One way to do that is to have special interface method, bound to Clojure
function, which can perform necessary injection by using mutable objects  
in Clojure code. But that doesn't look like a functional way.


How are Java objects usually passed to Clojure code? The recommended way?


I would like Howard to elaborate on this topic, because I'm currently
researching various options and yet none of them looks quite right. But I
don't have much experience in Clojure, so I might be missing something
obvious.


Your suggested code hints at a Clojure function, provided by Tapestry,  
that would somehow provide access to services through the registry. I  
guess you're in the right path.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Tapestry and Clojure

2014-12-15 Thread Ilya Obshadko
On Sun, Dec 14, 2014 at 9:17 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Sat, 13 Dec 2014 17:48:09 -0200, Ilya Obshadko 
> wrote:
>
>  I have a question regarding potential Clojure integration in my
>> application
>> service layer. As of now, standard Tapestry mechanism of dependency
>> injection won't work for Clojure-based services, because it's constructed
>> using ServiceBuilder and there is no implementation class.
>>
>
> ServiceBuilder's buildService() receives a ServiceResources instance as a
> parameter. ServiceResources is an ObjectLocator (i.e. Tapestry-IoC
> registry).


The wording of my question was not fully correct. tapestry-clojure doesn't
use ServiceBuilder, but rather its own ClojureBuilder (which does the job
of creating service proxy and binding service interface methods to Clojure
functions in a given namespace).

One way to do that is to have special interface method, bound to Clojure
function, which can perform necessary injection by using mutable objects in
Clojure code. But that doesn't look like a functional way.

I would like Howard to elaborate on this topic, because I'm currently
researching various options and yet none of them looks quite right. But I
don't have much experience in Clojure, so I might be missing something
obvious.


> I understand that it probably cannot be solved directly, but what
>> alternative scenarios do we have at our disposal?
>>
>> One of them is probably a custom service builder. Any others?
>>
>
> You can use builder methods (YourService buildYourService()) or
> bind(Class serviceInterface, ServiceBuilder builder). Pass the
> services you want to your Clojure code as objects.



-- 
Ilya Obshadko


Re: Problems with the Palette component

2014-12-15 Thread Bob Harner
Benjamin,

I can't reproduce your problem. I just created a new project using the
Maven Archetype for Tapestry 5.3.8, then added the OrderHandling page
exactly as described at
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html
and it worked fine. (I could move items between the left and right
lists with no problems.) Then I upgraded to Tapestry 5.3.8 (by editing
the version in the pom.xml file) and it still worked fine.

I suggest you look for JavaScript errors in your browser's console.
Something you've added might be messing with the JavaScript that the
Palette component uses.


On Mon, Dec 15, 2014 at 10:45 AM, Chris Poulsen  wrote:
> I have never used the palette, but have you had a look at the
> tapestry-5\tapestry-core\src\test\java\org\apache\tapestry5\integration\app1\pages\PaletteDemo.java
> file?
>
> On Mon, Dec 15, 2014 at 4:38 PM, Berghoff, Benjamin <
> benjamin.bergh...@isst.fraunhofer.de> wrote:
>>
>> I use java 32 bit.
>> The "Dms" class is a Simple Enumeration class.
>>
>> Regards
>> Benjamin B.
>>
>> Von: B, Benjamin
>> Gesendet: Montag, 15. Dezember 2014 16:32
>> An: users@tapestry.apache.org
>> Betreff: Problems with the Palette component
>>
>> Hi,
>>
>> I'm using tapestry-jpa 5.3.8. I use Eclipse JavaEE Kepler, the jre is
>> oracle 1.7.0_51.
>> The used pom.xml is attached. The project is built upon the project
>> created by "mvn archetype:generate -DarchetypeCatalog=
>> http://tapestry.apache.org";.
>> When I tried to implement the example on,
>> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html,
>> I got stuck as the example doesn't works as expected.
>> At first it seemed to work, the component has been displayed correctly,
>> but when I select one of the available items the corresponding button is
>> still disabled. See PaletteError.jpg for a snapshot.
>> This behavior is the same for Opera 12. 17, Firefox 34.0.5 and Chrome
>> 39.0.2171.95 m.
>>
>> Does anybody has a clue what's wrong?
>> If my description lacks any required information I will be glad to provide
>> it, to get my problem solved.
>>
>> Thanks and Regards
>> Benjamin B.
>>
>>
>> My Java File Dummy.java:
>> package .pages;
>>
>> import java.util.List;
>>
>> import org.apache.tapestry5.SelectModel;
>> import org.apache.tapestry5.ValueEncoder;
>> import org.apache.tapestry5.annotations.Persist;
>> import org.apache.tapestry5.annotations.Property;
>> import org.apache.tapestry5.ioc.Messages;
>> import org.apache.tapestry5.ioc.annotations.Inject;
>> import org.apache.tapestry5.ioc.services.TypeCoercer;
>> import org.apache.tapestry5.util.EnumSelectModel;
>> import org.apache.tapestry5.util.EnumValueEncoder;
>>
>> import .DMS;
>>
>> public class Dummy {
>>
>> @Property
>> @Persist
>> private List handling;
>>
>> @Inject
>> private Messages messages;
>>
>>@Inject
>> private TypeCoercer typeCoercer;
>>
>> @Property
>> private final ValueEncoder encoder = new
>> EnumValueEncoder(typeCoercer, DMS.class);
>>
>> @Property
>> private final SelectModel model = new EnumSelectModel(DMS.class,
>> messages);
>> }
>>
>> My tml (1:1 copy) :
>> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>> 
>> Special Handling
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>> 
>>

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



Re: Problems with the Palette component

2014-12-15 Thread Bob Harner
To be clear, I first tried Tapestry 5.3.7, then 5.3.8, and both worked fine.

On Mon, Dec 15, 2014 at 12:07 PM, Bob Harner  wrote:
> Benjamin,
>
> I can't reproduce your problem. I just created a new project using the
> Maven Archetype for Tapestry 5.3.8, then added the OrderHandling page
> exactly as described at
> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html
> and it worked fine. (I could move items between the left and right
> lists with no problems.) Then I upgraded to Tapestry 5.3.8 (by editing
> the version in the pom.xml file) and it still worked fine.
>
> I suggest you look for JavaScript errors in your browser's console.
> Something you've added might be messing with the JavaScript that the
> Palette component uses.
>
>
> On Mon, Dec 15, 2014 at 10:45 AM, Chris Poulsen  
> wrote:
>> I have never used the palette, but have you had a look at the
>> tapestry-5\tapestry-core\src\test\java\org\apache\tapestry5\integration\app1\pages\PaletteDemo.java
>> file?
>>
>> On Mon, Dec 15, 2014 at 4:38 PM, Berghoff, Benjamin <
>> benjamin.bergh...@isst.fraunhofer.de> wrote:
>>>
>>> I use java 32 bit.
>>> The "Dms" class is a Simple Enumeration class.
>>>
>>> Regards
>>> Benjamin B.
>>>
>>> Von: B, Benjamin
>>> Gesendet: Montag, 15. Dezember 2014 16:32
>>> An: users@tapestry.apache.org
>>> Betreff: Problems with the Palette component
>>>
>>> Hi,
>>>
>>> I'm using tapestry-jpa 5.3.8. I use Eclipse JavaEE Kepler, the jre is
>>> oracle 1.7.0_51.
>>> The used pom.xml is attached. The project is built upon the project
>>> created by "mvn archetype:generate -DarchetypeCatalog=
>>> http://tapestry.apache.org";.
>>> When I tried to implement the example on,
>>> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html,
>>> I got stuck as the example doesn't works as expected.
>>> At first it seemed to work, the component has been displayed correctly,
>>> but when I select one of the available items the corresponding button is
>>> still disabled. See PaletteError.jpg for a snapshot.
>>> This behavior is the same for Opera 12. 17, Firefox 34.0.5 and Chrome
>>> 39.0.2171.95 m.
>>>
>>> Does anybody has a clue what's wrong?
>>> If my description lacks any required information I will be glad to provide
>>> it, to get my problem solved.
>>>
>>> Thanks and Regards
>>> Benjamin B.
>>>
>>>
>>> My Java File Dummy.java:
>>> package .pages;
>>>
>>> import java.util.List;
>>>
>>> import org.apache.tapestry5.SelectModel;
>>> import org.apache.tapestry5.ValueEncoder;
>>> import org.apache.tapestry5.annotations.Persist;
>>> import org.apache.tapestry5.annotations.Property;
>>> import org.apache.tapestry5.ioc.Messages;
>>> import org.apache.tapestry5.ioc.annotations.Inject;
>>> import org.apache.tapestry5.ioc.services.TypeCoercer;
>>> import org.apache.tapestry5.util.EnumSelectModel;
>>> import org.apache.tapestry5.util.EnumValueEncoder;
>>>
>>> import .DMS;
>>>
>>> public class Dummy {
>>>
>>> @Property
>>> @Persist
>>> private List handling;
>>>
>>> @Inject
>>> private Messages messages;
>>>
>>>@Inject
>>> private TypeCoercer typeCoercer;
>>>
>>> @Property
>>> private final ValueEncoder encoder = new
>>> EnumValueEncoder(typeCoercer, DMS.class);
>>>
>>> @Property
>>> private final SelectModel model = new EnumSelectModel(DMS.class,
>>> messages);
>>> }
>>>
>>> My tml (1:1 copy) :
>>> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>>> 
>>> Special Handling
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>> 
>>>

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



Re: Problems with the Palette component

2014-12-15 Thread Chris Poulsen
I have never used the palette, but have you had a look at the
tapestry-5\tapestry-core\src\test\java\org\apache\tapestry5\integration\app1\pages\PaletteDemo.java
file?

On Mon, Dec 15, 2014 at 4:38 PM, Berghoff, Benjamin <
benjamin.bergh...@isst.fraunhofer.de> wrote:
>
> I use java 32 bit.
> The "Dms" class is a Simple Enumeration class.
>
> Regards
> Benjamin B.
>
> Von: B, Benjamin
> Gesendet: Montag, 15. Dezember 2014 16:32
> An: users@tapestry.apache.org
> Betreff: Problems with the Palette component
>
> Hi,
>
> I'm using tapestry-jpa 5.3.8. I use Eclipse JavaEE Kepler, the jre is
> oracle 1.7.0_51.
> The used pom.xml is attached. The project is built upon the project
> created by "mvn archetype:generate -DarchetypeCatalog=
> http://tapestry.apache.org";.
> When I tried to implement the example on,
> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html,
> I got stuck as the example doesn't works as expected.
> At first it seemed to work, the component has been displayed correctly,
> but when I select one of the available items the corresponding button is
> still disabled. See PaletteError.jpg for a snapshot.
> This behavior is the same for Opera 12. 17, Firefox 34.0.5 and Chrome
> 39.0.2171.95 m.
>
> Does anybody has a clue what's wrong?
> If my description lacks any required information I will be glad to provide
> it, to get my problem solved.
>
> Thanks and Regards
> Benjamin B.
>
>
> My Java File Dummy.java:
> package .pages;
>
> import java.util.List;
>
> import org.apache.tapestry5.SelectModel;
> import org.apache.tapestry5.ValueEncoder;
> import org.apache.tapestry5.annotations.Persist;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.ioc.Messages;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.apache.tapestry5.ioc.services.TypeCoercer;
> import org.apache.tapestry5.util.EnumSelectModel;
> import org.apache.tapestry5.util.EnumValueEncoder;
>
> import .DMS;
>
> public class Dummy {
>
> @Property
> @Persist
> private List handling;
>
> @Inject
> private Messages messages;
>
>@Inject
> private TypeCoercer typeCoercer;
>
> @Property
> private final ValueEncoder encoder = new
> EnumValueEncoder(typeCoercer, DMS.class);
>
> @Property
> private final SelectModel model = new EnumSelectModel(DMS.class,
> messages);
> }
>
> My tml (1:1 copy) :
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> 
> Special Handling
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
> 
>


AW: Problems with the Palette component

2014-12-15 Thread Berghoff, Benjamin
I use java 32 bit.
The "Dms" class is a Simple Enumeration class.

Regards
Benjamin B.

Von: B, Benjamin
Gesendet: Montag, 15. Dezember 2014 16:32
An: users@tapestry.apache.org
Betreff: Problems with the Palette component

Hi,

I'm using tapestry-jpa 5.3.8. I use Eclipse JavaEE Kepler, the jre is oracle 
1.7.0_51.
The used pom.xml is attached. The project is built upon the project created by 
"mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org";.
When I tried to implement the example on, 
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html,
 I got stuck as the example doesn't works as expected.
At first it seemed to work, the component has been displayed correctly, but 
when I select one of the available items the corresponding button is still 
disabled. See PaletteError.jpg for a snapshot.
This behavior is the same for Opera 12. 17, Firefox 34.0.5 and Chrome 
39.0.2171.95 m.

Does anybody has a clue what's wrong?
If my description lacks any required information I will be glad to provide it, 
to get my problem solved.

Thanks and Regards
Benjamin B.


My Java File Dummy.java:
package .pages;

import java.util.List;

import org.apache.tapestry5.SelectModel;
import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.util.EnumSelectModel;
import org.apache.tapestry5.util.EnumValueEncoder;

import .DMS;

public class Dummy {

@Property
@Persist
private List handling;

@Inject
private Messages messages;

   @Inject
private TypeCoercer typeCoercer;

@Property
private final ValueEncoder encoder = new EnumValueEncoder(typeCoercer, 
DMS.class);

@Property
private final SelectModel model = new EnumSelectModel(DMS.class, messages);
}

My tml (1:1 copy) :
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

Special Handling















Re: Returning json when request is non xhr

2014-12-15 Thread Chris Poulsen
You could try to add your own ComponentEventResultProcessor -
However I do not know whether this interferes with the built in tapestry
stuff for ajax - If that is the case you could probably return a different
type of json.

Check (StreamResponse/StreamResponseResultProcessor) in tapestry sources
for an example of how to add the code

-- 
Chris

On Mon, Dec 15, 2014 at 4:16 PM, Nathan Quirynen <
nat...@pensionarchitects.be> wrote:
>
> Hi,
>
> I have 2 applications (different servers):
> 1) html + js
> 2) Tapestry5
>
> Now I tried to do an ajax request (jquery) from application 1 to
> application 2 where I want to return some json back to application 1.
> But because cross domain get requests do not use XHR I get following
> error in application 2:
>
> Return type org.apache.tapestry5.json.JSONObject can not be handled.
>
> So how can I return json if the request is not XHR ?
>


Problems with the Palette component

2014-12-15 Thread Berghoff, Benjamin
Hi,

I'm using tapestry-jpa 5.3.8. I use Eclipse JavaEE Kepler, the jre is oracle 
1.7.0_51.
The used pom.xml is attached. The project is built upon the project created by 
"mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org";.
When I tried to implement the example on, 
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Palette.html,
 I got stuck as the example doesn't works as expected.
At first it seemed to work, the component has been displayed correctly, but 
when I select one of the available items the corresponding button is still 
disabled. See PaletteError.jpg for a snapshot.
This behavior is the same for Opera 12. 17, Firefox 34.0.5 and Chrome 
39.0.2171.95 m.

Does anybody has a clue what's wrong?
If my description lacks any required information I will be glad to provide it, 
to get my problem solved.

Thanks and Regards
Benjamin B.


My Java File Dummy.java:
package .pages;

import java.util.List;

import org.apache.tapestry5.SelectModel;
import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.util.EnumSelectModel;
import org.apache.tapestry5.util.EnumValueEncoder;

import .DMS;

public class Dummy {

@Property
@Persist
private List handling;

@Inject
private Messages messages;

   @Inject
private TypeCoercer typeCoercer;

@Property
private final ValueEncoder encoder = new EnumValueEncoder(typeCoercer, 
DMS.class);

@Property
private final SelectModel model = new EnumSelectModel(DMS.class, messages);
}

My tml (1:1 copy) :
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

Special Handling















pom.xml
Description: pom.xml

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

Returning json when request is non xhr

2014-12-15 Thread Nathan Quirynen
Hi,

I have 2 applications (different servers):
1) html + js
2) Tapestry5

Now I tried to do an ajax request (jquery) from application 1 to
application 2 where I want to return some json back to application 1.
But because cross domain get requests do not use XHR I get following
error in application 2:

Return type org.apache.tapestry5.json.JSONObject can not be handled.

So how can I return json if the request is not XHR ?


Re: CompressionAnalyzerImpl exception

2014-12-15 Thread George Christman
Howard, you were correct. the MIME type was null. CompressionAnalyzerImpl
was failing on line 32 do to contentType being null. As you stated, this
NPE is a failure and should probably be checked and thrown with a proper
message. I ended up having to override the service in order to resolve the
issue.

https://github.com/apache/tapestry-5/blob/90766995f59048cb7f7d4cf042a21a9d728583db/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/CompressionAnalyzerImpl.java

On Tue, Dec 9, 2014 at 2:30 PM, Howard Lewis Ship  wrote:
>
> Well, right off the bat, any NPE like this (with no additional message to
> explain it) is a failure.
>
> Was there anything special about the page being rendered?  It seems like
> the MIME type of the page is null, that's what might cause this NPE.
>
> On Tue, Dec 9, 2014 at 11:01 AM, George Christman  >
> wrote:
>
> > I just started using gzip etc and I'm not getting the following
> exception.
> > Does anybody know what it means or how to fix it?
> >
> > Caused by: java.lang.NullPointerException at
> org.apache.tapestry5.internal.
> >
> >
> services.assets.CompressionAnalyzerImpl.isCompressable(CompressionAnalyzerImpl.java:32)
> > at $CompressionAnalyzer_10e85f85a5.isCompressable(Unknown Source) at
> >
> >
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:77)
> > at
> >
> >
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70)
> > at
> >
> >
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:118)
> > at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) at
> > sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282) at
> > sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) at
> > java.io.OutputStreamWriter.write(OutputStreamWriter.java:207) at
> > java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129) at
> > java.io.BufferedWriter.close(BufferedWriter.java:265) at
> > java.io.PrintWriter.close(PrintWriter.java:339) at
> >
> >
> org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:85)
> > at $PageResponseRenderer_10e85f8608.renderPageResponse(Unknown Source) at
> >
> >
> org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:72)
> > at
> >
> >
> org.apache.tapestry5.modules.TapestryModule$34.handle(TapestryModule.java:1978)
> > at $PageRenderRequestHandler_10e85f860a.handle(Unknown Source) at
> > $PageRenderRequestHandler_10e85f8605.handle(Unknown Source) at
> >
> >
> org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
> > at
> >
> >
> org.apache.tapestry5.internal.services.DeferredResponseRenderer.handlePageRender(DeferredResponseRenderer.java:52)
> > at $ComponentRequestHandler_10e85f8606.handlePageRender(Unknown Source)
> at
> >
> >
> org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
> > at $ComponentRequestHandler_10e85f8606.handlePageRender(Unknown Source)
> at
> >
> >
> org.apache.tapestry5.internal.services.ProductionModeUnknownComponentFilter.handlePageRender(ProductionModeUnknownComponentFilter.java:62)
> > at $ComponentRequestHandler_10e85f8606.handlePageRender(Unknown Source)
> at
> >
> >
> org.apache.tapestry5.internal.services.RequestOperationTracker$2.run(RequestOperationTracker.java:73)
> > at
> >
> >
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:56)
> > ... 69 more
> >
> >
> > --
> > George Christman
> > CEO
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>
>
>
> --
> 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
> @hlship
>


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Tapestry5 jquery ajaxupload in Form

2014-12-15 Thread George Christman
You need to provide additional information such as code example etc. Your
question is a little to vague.

On Mon, Dec 15, 2014 at 4:59 AM, Bosch, Christian  wrote:
>
> Hello,
>
>  I written a tapestry component embedding Tapestry JQuery AjaxUpload
> (Tapestry 5.3.7 and Tapestry Jquery 3.3.4).
> My component is part of t:form. Once a file is uploaded, submit buttons of
> form are no longer working.
> Any idea ?
>
> Thanks,
> C. BOSCH.
>


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Tapestry5 jquery ajaxupload in Form

2014-12-15 Thread Bosch, Christian
Hello,

 I written a tapestry component embedding Tapestry JQuery AjaxUpload (Tapestry 
5.3.7 and Tapestry Jquery 3.3.4).
My component is part of t:form. Once a file is uploaded, submit buttons of form 
are no longer working.
Any idea ?

Thanks,
C. BOSCH.