Here is a simple example with which you can compare 

public class ExportXML {

    StreamResponse onActivate(){
        return new StreamResponse() {
            @Override
            public String getContentType() {
                return "text/xml";
            }

            @Override
            public InputStream getStream() throws IOException {
                String xml = "<?xml version='1.0'?>\n" +
                        "<message>Hello</message>";
                ByteArrayInputStream in = new ByteArrayInputStream(
                    xml.getBytes()
                );

                return in;
            }

            @Override
            public void prepareResponse(Response response) {
            }
        };
    }
}

BTW what tapestry version are you using( just to ensure we are dealing with 
tapestry5 :))

Also I remember one case where a developer had implemented StreamResponse as a 
public class in the pages sub-package. That can also lead to this issue.

regards
Taha

On Oct 16, 2011, at 10:21 AM, Amr Mohamed Mahmoud Hassanien wrote:

> Ok ...you are right and  I changed the 'O' to 'o'. but the same I am getting 
> , break point not hit and an error.
> 
> OnEvent the same too.
> 
> Regards,
> 
> -----Original Message-----
> From: Taha Hafeez Siddiqi [mailto:tawus.tapes...@gmail.com] 
> Sent: 13 أكتوبر, 2011 05:47 م
> To: Tapestry users
> Subject: Re: Uncaught exception when tried to return a StreamResponse
> 
> Hi Amr
> 
> Are you sure your onActivate() is being called. BTW, your onActivate() has 
> 'O' in uppercase.  To avoid such typos I prefer the OnEvent annotation
> 
> regards
> Taha
> 
> On Oct 13, 2011, at 7:14 PM, Amr Mohamed Mahmoud Hassanien wrote:
> 
>> Hi Guys,
>> 
>>      I want to export data in excel sheet, so I made a page class as the 
>> following without a template file(.tml)
>> 
>> public class ExportExcel {
>>      .
>>      .
>>      .
>>      
>>      StreamResponse OnActivate(){
>>              List<User> users = userManager.getAllActiveUsers();        // 
>> break point here never got hit
>>              return export(users);
>>      }
>>      
>>      public StreamResponse export(List<List<String>> rows) {
>>              // some logic to export the data in .xls
>>      }
>> }
>> 
>> And this is the error I got:
>> Page export/Excel did not generate any markup when rendered. This could be 
>> because its template file could not be located, or because a render phase 
>> method in the page prevented rendering.
>> 
>> 
>> And I am using this page link.
>> <t:pagelink t:page="export/excel"
>>                     title="message:export-label"/>
>> 
>> any idea what is the problem ?
>> 
>> Thanks in Advance,
>> Amr Hassanin
>> 
>> ######################################################################
>> ##########################################
>> DISCLAIMER:
>> This message is for the named person's use only. It may contain 
>> confidential information, proprietary in nature or legally privileged 
>> information. All trade secret, know how, formulas, researches, 
>> database, software, codes diagrams, documentations, attachments, 
>> voice, concepts and visual content are strictly protected by United 
>> Arab Emirates Laws and Dubai Media Incorporated codes which will have 
>> the right to take any legal action if you fail in doing the hereunder steps. 
>> If you receive this message in error, please immediately DELETE it and all 
>> copies of it from your system, DESTROY any hard copies of it and destroy any 
>> soft and backup copy of it saved in any kind of form under you possession 
>> and NOTIFY the sender.
>> You must not, directly or indirectly, use, disclose, distribute, 
>> print, or copy any part of this message (email) if you are not the intended 
>> recipient.
>> ######################################################################
>> ##########################################
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> ################################################################################################################
> DISCLAIMER:
> This message is for the named person's use only. It may contain confidential 
> information, proprietary 
> in nature or legally privileged information. All trade secret, know how, 
> formulas, researches, database, 
> software, codes diagrams, documentations, attachments, voice, concepts and 
> visual content are strictly 
> protected by United Arab Emirates Laws and Dubai Media Incorporated codes 
> which will have the right to 
> take any legal action if you fail in doing the hereunder steps. If you 
> receive this message in error, 
> please immediately DELETE it and all copies of it from your system, DESTROY 
> any hard copies of it and 
> destroy any soft and backup copy of it saved in any kind of form under you 
> possession and NOTIFY the sender.  
> You must not, directly or indirectly, use, disclose, distribute, print, or 
> copy any part of this message (email) 
> if you are not the intended recipient.
> ################################################################################################################
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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

Reply via email to