tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Trewin" <...@canfactory.com>
Subject RE: Need help in creating session object
Date Fri, 09 Sep 2005 08:51:16 GMT
I've accomplished a similar process by setting my ApplicationState
object to be a simple wrapper object. When a user logs in I create an
authentication session object, which I then set in the actual ASO
wrapper object. So I can find out if someone is logged in by checking
the ASO to see if it contains a session object.

That way the hivemind directive simply needs to create an instance of
the ASO object, with no further configuration, as all the details are
held inside the contained object.

-----Original Message-----
From: Anjali Abraham [mailto:anjalia@aztec.soft.net] 
Sent: 09 September 2005 07:11
To: Tapestry users
Subject: RE: Need help in creating session object

Hi,
	I am not getting what I need to add in my hivemodule.xml file
for the create-instance class element value.
The content in my hivemodule.xml is:
<?xml version="1.0"?>
<module id="xxx" version="1.1.0" package="xxx.yyy.pages">
	<contribution
configuration-id="tapestry.state.ApplicationObjects">
		<state-object name="zzz" scope="session">
			<create-instance class="(DON'T KNOW WHETHER I
NEED TO CREATE A NEW CALSS FOR THIS OR NOT)"/>
   		</state-object> 
	</contribution>
</module>

Actually I have a login page where in I have 2 fields, ie username and
password, if the login is successful I need to create a session and
store the username and password in that object.
For the login page, I have Login.java file where I have put this code:
@InjectState("zzz ")
    public abstract (don't know)  getzzz();

My Doubt here is:
Is that I need to create a new java class which should have getter's and
setter's methods for username and password and that class need to be put
in the hivmodule.xml " create-instance class" element?????

And also is that the username and password values gets set automatically
into that java class which I mention in hivemodule.xml or not????

And also how I need to retrieve those values in my Login.java files or
any other java files???

Please need help regarding this as soon as possible,

Thanks in advance,

Regards,
Anjali

-----Original Message-----
From: Nils Zonneveld [mailto:n.zonneveld@topdesk.com]
Sent: Friday, September 02, 2005 2:37 PM
To: Tapestry users
Subject: Re: Need help in creating session object

Anjali Abraham wrote:

>Hi All,
>            How to create session objects in tapestry4.0v, i.e. What 
>code need to be added into .page and .java file for the same?
> 
>Thanks in Advance,
> 
>Regards,
>Anjali
> 
>
>  
>
I use Tapestry 3.0.3. With "Session object", I assume you mean a
HttpSession object.

Tapestry uses a Visit object for HttpSession like storage.

put

    <property name="org.apache.tapestry.visit-class"
      value="com.foo.bar.system.Visit" />

in your .application file. The Visit class is just a POJO that
implements Serializable.


HTH,

Nils Zonneveld

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message