We have all been hacking away in JSP that, I for one, have forgotten how to
code properly. What is OO again? ;)
Martijn Dashorst wrote:
>
> Why go through the session in the first place?
>
> Why not:
>
> public class Page1 extends WebPage {
> public Page1() {
> add(new Link("link") {
> protected void onClick() {
> setResponsePage(new Page2("Some string"));
> }
> });
> }
> }
>
> public class Page2 extends WebPage {
> public Page2(String text) {
> add(new Label("label", text));
> }
> }
>
>
>
> On 9/17/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>> hi edi,
>>
>> typically, you would subclass from WebSession and provide your own
>> typesafe
>> getters and setters:
>>
>> public class MySession extends WebSession {
>> private String myString;
>>
>> public String getMyString() { return myString; }
>> public void setMyString(String myString) { this.myString = myString; }
>> }
>>
>>
>> in your page you would do something like this:
>>
>> String myString = ((MySession)Session.get()).getMyString();
>>
>>
>> that's it...
>>
>> hth,
>> gerolf
>>
>> On 9/17/07, Edi <[EMAIL PROTECTED]> wrote:
>> >
>> >
>> > Hello,
>> >
>> > I am the newbie of wicket. I want to store some string in session. And
>> i
>> > want to get that session and display into another page. How?
>> >
>> >
>> > in jsp,
>> > I can set session like
>> > session.setAttribute("session","session");
>> >
>> > and easily get
>> > session.getAttribute("session");
>> >
>> > Using the above getAttribute method. In wicket How can I do this?
>> >
>> > Please explain.
>> > --
>> > View this message in context:
>> > http://www.nabble.com/Regarding-Wicket-Session-tf4466808.html#a12736184
>> > Sent from the Wicket - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0-beta3 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Regarding-Wicket-Session-tf4466808.html#a12752782
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]