Re: How to pass params with 'URL herf'

2008-10-13 Thread Lukasz Lenart
2008/10/13 Mead Lai <[EMAIL PROTECTED]>: > yes, have any clue? > public class Page { >private int num; >private int size = Constant.PAGE_SIZE; >private int volume; > > >private int index;// current page >public Page(){ > >} > > public int getIndex() { >return this.

Re: How to pass params with 'URL herf'

2008-10-13 Thread Dave Newton
--- On Mon, 10/13/08, Lukasz Lenart wrote: > Yes, you can use them like that, only remeber to have > public getters and setters (for Page and for Index) For Struts 2.1.3, at least, you can actually use public properties w/o the s/getters. Whether or not that's a good idea is, of course, a differe

Re: How to pass params with 'URL herf'

2008-10-13 Thread Mead Lai
yes, have any clue? public class Page { private int num; private int size = Constant.PAGE_SIZE; private int volume; private int index;// current page public Page(){ } public int getIndex() { return this.index >= 0 ? this.index : 0; } public void setIn

Re: How to pass params with 'URL herf'

2008-10-13 Thread Lukasz Lenart
2008/10/13 Mead Lai <[EMAIL PROTECTED]>: > well, It's not work, > It throw NullPointException at following line: > System.out.println("##index" + this.page.getIndex()); > It seems page object haven't been created? Does your Page class has default constructor? Regards -- Lukasz http://www.le

Re: How to pass params with 'URL herf'

2008-10-13 Thread Mead Lai
well, It's not work, It throw NullPointException at following line: System.out.println("##index" + this.page.getIndex()); It seems page object haven't been created? full code: public class myAction{ private Page page; public Page getPage() { return page; } public void s

Re: How to pass params with 'URL herf'

2008-10-13 Thread Lukasz Lenart
2008/10/13 Mead Lai <[EMAIL PROTECTED]>: > I have added public getters and setters methods. > but how to write the struts tag > > > 12 > > > can I use to set model properties? Yes, you can use them like that, only remeber to have public getters and setters (for Page and for Index) Regards --

Re: How to pass params with 'URL herf'

2008-10-13 Thread Mead Lai
; } } --BestRegards, Mead On Mon, Oct 13, 2008 at 4:15 PM, Lukasz Lenart <[EMAIL PROTECTED] > wrote: > 2008/10/13 Mead Lai <[EMAIL PROTECTED]>: > > How to pass params with 'URL herf'? > > well, the params data wanne pass to Model's property. > > such,

Re: How to pass params with 'URL herf'

2008-10-13 Thread Lukasz Lenart
2008/10/13 Mead Lai <[EMAIL PROTECTED]>: > How to pass params with 'URL herf'? > well, the params data wanne pass to Model's property. > such, I have a "page" object in myAction, with get and set method. > > public class myAction{ > private P

How to pass params with 'URL herf'?

2008-10-12 Thread Mead Lai
How to pass params with 'URL herf'? well, the params data wanne pass to Model's property. such, I have a "page" object in myAction, with get and set method. public class myAction{ private Page page; } public class Page{ public int index; public int next; } my struts t

How to pass params with 'URL herf'

2008-10-12 Thread Mead Lai
How to pass params with 'URL herf'? well, the params data wanne pass to Model's property. such, I have a "page" object in myAction, with get and set method. public class myAction{ private Page page; } public class Page{ public int index; public int next; } my str