Re: Have any DynamicByteArrayResource sample?

2008-04-07 Thread rosen jiang

well, I have some idea:

ByteArrayOutputStream baos = new ByteArrayOutputStream();

.
.
.
add(new Link("download") {
public void onClick() {
 WebResponse response = (WebResponse) getResponse();
 response.setHeader("Content-Disposition",
"attachment;filename=" + "aaa.xls");

response.setContentType("application/x-msdownload");
 response.getOutputStream().write(baos.toByteArray());
 baos.flush();
 baos.close();
 }});

It's work! very easy, like a Servlet, but above codes need some
try-catch-finally block.


Nino.Martinez wrote:
> 
> take a look at DynamicImageResource.. It should give some hints.
> 
> 
> 
> rosen jiang wrote:
>> Hi all,
>>
>> I want use DynamicByteArrayResource class download Excel(ByteArray
>> Resource  
>> not File) from jexcelapi.
>> Does DynamicByteArrayResource class fit for me?
>>
>> thx!
>> best regards,
>> osen jiang
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Have-any-DynamicByteArrayResource-sample--tp16525712p16537476.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Have any DynamicByteArrayResource sample?

2008-04-07 Thread rosen jiang

thank you Nino!

God "The type DynamicByteArrayResource is deprecated" in version
1.3.2...
I think i should waiting for 1.3.3.


Nino.Martinez wrote:
> 
> take a look at DynamicImageResource.. It should give some hints.
> 
> 
> 
> rosen jiang wrote:
>> Hi all,
>>
>> I want use DynamicByteArrayResource class download Excel(ByteArray
>> Resource  
>> not File) from jexcelapi.
>> Does DynamicByteArrayResource class fit for me?
>>
>> thx!
>> best regards,
>> osen jiang
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Have-any-DynamicByteArrayResource-sample--tp16525712p16537430.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Have any DynamicByteArrayResource sample?

2008-04-06 Thread rosen jiang

Hi all,

I want use DynamicByteArrayResource class download Excel(ByteArray Resource  
not File) from jexcelapi.
Does DynamicByteArrayResource class fit for me?

thx!
best regards,
osen jiang
-- 
View this message in context: 
http://www.nabble.com/Have-any-DynamicByteArrayResource-sample--tp16525712p16525712.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: warning: [deprecation] AuthenticatedWebSession(AuthenticatedWebApplication,Request)

2008-04-06 Thread rosen jiang

Hi all,

I encounter the same problem, how to resolve it?

thx!
-rosen jiang


Johnnie wrote:
> 
> Hi,
> 
> I'm using Wicket 1.3.2, had a piece of code that read like this:
> 
> public MySession(final AuthenticatedWebApplication application,
> final Request   request) {
> 
> super(application, request);
> 
> }
> 
> and was getting the following warning:
> 
>   warning: [deprecation]
> AuthenticatedWebSession(org.apache.wicket.authentication.AuthenticatedWebApplication,org.apache.wicket.Request)
> in org.apache.wicket.authentication.AuthenticatedWebSession has been
> deprecated
> 
> so I tried to use the form of the constructor that takes only one argument
> - Request, like so:
> 
> public ElectronicaSession(final AuthenticatedWebApplication
> application,
> final Request   request) {
> 
> super(request);
> 
> }
> 
> and now I get:
> 
> org.apache.wicket.WicketRuntimeException: Unable to instantiate web
> session class my.package.MySession
> 
> org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:120)
>   org.apache.wicket.Session.findOrCreate(Session.java:228)
>   org.apache.wicket.Session.findOrCreate(Session.java:211)
>   org.apache.wicket.Session.get(Session.java:250)
>   org.apache.wicket.Application$1.onInstantiation(Application.java:276)
> 
> org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:974)
>   org.apache.wicket.Component.(Component.java:866)
>   org.apache.wicket.MarkupContainer.(MarkupContainer.java:105)
>   org.apache.wicket.Page.(Page.java:236)
>   org.apache.wicket.markup.html.WebPage.(WebPage.java:184)
> 
> org.apache.wicket.markup.html.pages.ExceptionErrorPage.(ExceptionErrorPage.java:55)
> 
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:163)
>   org.apache.wicket.RequestCycle.step(RequestCycle.java:1280)
>   org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
>   org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>   
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
> 
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
> 
> How do I avoid both the warning and the error?
> 
> Best regards,
> 
> Johnny
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/warning%3A--deprecation--AuthenticatedWebSession%28AuthenticatedWebApplication%2CRequest%29-tp16329498p16524401.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: what's the difference between setResponsePage(java.lang.Class pageClass) & setResponsePage(Page page)

2008-02-10 Thread rosen jiang

Thanks Johan!
With your help, I think i understand the difference.

-rosenjiang


Johan Compagner wrote:
> 
> the first one you can use if you want to have a bookmarkable url in the
> browser
> also your page must have default constructor or PageParameter constructor
> 
> the second one can be used if you want to pass information to pages on the
> serverside
> also this generates a session spefic url (most of the time you can use
> hybrid url encoding)
> 
> johan
> 
> On Feb 10, 2008 2:20 PM, rosen jiang <[EMAIL PROTECTED]> wrote:
> 
>>
>> Dear all,
>>
>> I don't konw what's the difference, Because they are both working well.
>> Have some significant performances different?
>>
>> -rosenjiang
>> --
>> View this message in context:
>> http://www.nabble.com/what%27s-the-difference-between-setResponsePage%28java.lang.Class-pageClass%29---setResponsePage%28Page-page%29--tp15396145p15396145.html
>> Sent from the Wicket - User mailing list archive at
>> Nabble.com<http://nabble.com/>
>> .
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/what%27s-the-difference-between-setResponsePage%28java.lang.Class-pageClass%29---setResponsePage%28Page-page%29--tp15396145p15397143.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



what's the difference between setResponsePage(java.lang.Class pageClass) & setResponsePage(Page page)?

2008-02-10 Thread rosen jiang

Dear all,

I don't konw what's the difference, Because they are both working well.
Have some significant performances different?

-rosenjiang
-- 
View this message in context: 
http://www.nabble.com/what%27s-the-difference-between-setResponsePage%28java.lang.Class-pageClass%29---setResponsePage%28Page-page%29--tp15396145p15396145.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: About Page Expired of guestbook sample

2008-01-06 Thread rosen jiang

Finish!

It's my fault, i named the project as"wicket&db4o", so problem occurred.

thank you igor!

regards,
rosen jiang


rosen jiang wrote:
> 
> hi all,
> 
> I am studying guestbook sample of 1.3 right now, but encounter some
> problem:
> If i submit the form, then rising "Page Expired".
> 
> I have read this thread
> "http://www.nabble.com/forum/ViewPost.jtp?post=13663558&framed=y";, but
> nothing help.
> 
> Have anybody tried guestbook sample of 1.3?
> 
> regards,
> rosen jiang
> 

-- 
View this message in context: 
http://www.nabble.com/About-Page-Expired-of-guestbook-sample-tp14635300p14647337.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: About Page Expired of guestbook sample

2008-01-05 Thread rosen jiang

hi igor,

Yes, i have tweak mapping.
I am following "http://wicket.apache.org/exampleguestbook.html"; sample, my
GuestBookApplication.java and GuestBook.html and GuestBook.java and
Comment.java all same as sample, and all files put into com.cdsafe.guestbook
package.

This is my web.xml:


http://java.sun.com/dtd/web-app_2_3.dtd";>




GuestBookApplication
   
org.apache.wicket.protocol.http.WicketFilter

  applicationClassName
 
com.cdsafe.guestbook.GuestBookApplication



GuestBookApplication
/app/*




regards,
rosen jiang


igor.vaynberg wrote:
> 
> seems to work fine
> 
> http://wicketstuff.org/wicket13/guestbook/
> 
> did you tweak the filter mapping?
> 
> -igor
> 
> On Jan 5, 2008 8:23 AM, rosen jiang <[EMAIL PROTECTED]> wrote:
>>
>> hi all,
>>
>> I am studying guestbook sample of 1.3 right now, but encounter some
>> problem:
>> If i submit the form, then rising "Page Expired".
>>
>> I have read this thread
>> "http://www.nabble.com/forum/ViewPost.jtp?post=13663558&framed=y";, but
>> nothing help.
>>
>> Have anybody tried guestbook sample of 1.3?
>>
>> regards,
>> rosen jiang
>> --
>> View this message in context:
>> http://www.nabble.com/About-Page-Expired-of-guestbook-sample-tp14635300p14635300.html
>> Sent from the Wicket - User mailing list archive at Nabble.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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/About-Page-Expired-of-guestbook-sample-tp14635300p14644130.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



About Page Expired of guestbook sample

2008-01-05 Thread rosen jiang

hi all,

I am studying guestbook sample of 1.3 right now, but encounter some problem:
If i submit the form, then rising "Page Expired".

I have read this thread
"http://www.nabble.com/forum/ViewPost.jtp?post=13663558&framed=y";, but
nothing help.

Have anybody tried guestbook sample of 1.3?

regards,
rosen jiang
-- 
View this message in context: 
http://www.nabble.com/About-Page-Expired-of-guestbook-sample-tp14635300p14635300.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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