You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "zeallousbigpond.net.au" <ze...@bigpond.net.au> on 2003/09/09 04:00:22 UTC

method of implementing a 'login' section in a site

hi, 

    Thanks a lot for the email guys!! Another question I want to ask. I 
want to create a section of my site where I only allow users to use IF 
they have logged into my site. Either than using cookies to keep track 
if they have logged in or not, what method should I use to keep track 
of their status on each page?

Anson

----- Original Message -----
From: "Marco Tedone" <mt...@jemos.org>
Date: Tuesday, September 9, 2003 10:36 am
Subject: Re: EJB in tomcat

> Well, Tomcat needs to 'colloquiate' with an application server 
> (where EJBs
> are deployed). The answer is yes, it's possible; all your 
> application needs
> to do is to establish a context with an application server and 
> then it can
> use the component deployed on application server generally using a 
> lookup.
> Here follow a snippet from a code:
> 
> InitialContext context = null;
> //getJbossContext() sets up the correct property file and returns 
> a context
> initialized to that property file
> context = getJbossContext();
> Object node = context.lookup(sessionName);
> PeopleDbManagerHome home =
> (PeopleDbManagerHome)PortableRemoteObject.narrow(node,
> PeopleDbManagerHome.class);
> bean = home.create();
> } catch (RemoteException e) {
> printRemoteExceptionMessage();
> return null;
> }
> Hope it will help,
> 
> Marco
> 
> ----- Original Message ----- 
> From: "zeallousbigpond.net.au" <ze...@bigpond.net.au>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, September 09, 2003 1:17 AM
> Subject: EJB in tomcat
> 
> 
> > hi,
> >
> >      I would like to ask, can Tomcat work with Enterprise
> > Javabeans? 'cause I read from the Java site...it says that we 
> need a
> > BEA server? Is it necessary? Or tomcat it self already has those
> > libraries.
> >
> > Anson
> >
> >
> >
> > -----------------------------------------------------------------
> ----
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> 
> 
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
 


Re: method of implementing a 'login' section in a site

Posted by Marco Tedone <mt...@jemos.org>.
Well, what I can tell you what I've done, and then you're free to choose
(what a nice thing freedom...). I authenticated the user against a database;
if the user is authenticated, then I set a session attribute like (type
String): isUserAuthenticated.

Then, I wrote two custom tags (isUserAuthenticated, isNotUserAuthenticated)
which respectively executed the code within a <block></block> depending
whether the session attribute isUser exists (i.e. != null) or not. Then, in
my JSP page, I wrote something like the following:

<isNotUserAuthenticated>
  ....forward her to the login page
</isNotUserAuthenticated>

<isUserAuthenticated>
  <a href="..."></a>
  <a href="..."></a>
  <a href="..."></a>
</isUserAuthenticated>

I discovered this method is also useful to allow 'Administration'
functionality, so that similarly you may declared <isAdministrator>
<isNotAdministrator>

Hope this will help,

Marco
----- Original Message ----- 
From: "zeallousbigpond.net.au" <ze...@bigpond.net.au>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, September 09, 2003 3:00 AM
Subject: method of implementing a 'login' section in a site


> hi,
>
>     Thanks a lot for the email guys!! Another question I want to ask. I
> want to create a section of my site where I only allow users to use IF
> they have logged into my site. Either than using cookies to keep track
> if they have logged in or not, what method should I use to keep track
> of their status on each page?
>
> Anson
>
> ----- Original Message -----
> From: "Marco Tedone" <mt...@jemos.org>
> Date: Tuesday, September 9, 2003 10:36 am
> Subject: Re: EJB in tomcat
>
> > Well, Tomcat needs to 'colloquiate' with an application server
> > (where EJBs
> > are deployed). The answer is yes, it's possible; all your
> > application needs
> > to do is to establish a context with an application server and
> > then it can
> > use the component deployed on application server generally using a
> > lookup.
> > Here follow a snippet from a code:
> >
> > InitialContext context = null;
> > //getJbossContext() sets up the correct property file and returns
> > a context
> > initialized to that property file
> > context = getJbossContext();
> > Object node = context.lookup(sessionName);
> > PeopleDbManagerHome home =
> > (PeopleDbManagerHome)PortableRemoteObject.narrow(node,
> > PeopleDbManagerHome.class);
> > bean = home.create();
> > } catch (RemoteException e) {
> > printRemoteExceptionMessage();
> > return null;
> > }
> > Hope it will help,
> >
> > Marco
> >
> > ----- Original Message ----- 
> > From: "zeallousbigpond.net.au" <ze...@bigpond.net.au>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, September 09, 2003 1:17 AM
> > Subject: EJB in tomcat
> >
> >
> > > hi,
> > >
> > >      I would like to ask, can Tomcat work with Enterprise
> > > Javabeans? 'cause I read from the Java site...it says that we
> > need a
> > > BEA server? Is it necessary? Or tomcat it self already has those
> > > libraries.
> > >
> > > Anson
> > >
> > >
> > >
> > > -----------------------------------------------------------------
> > ----
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> >
> >
> > -------------------------------------------------------------------
> > --
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>




Re: method of implementing a 'login' section in a site

Posted by Schalk <sc...@volume4.co.za>.
Anson

I would suggest using session tracking to keep track of this state. Place the user in your session and have a small function run in the head of your pages checking for this. If no username is found then call, session.invalidate and redirect the user back to the login screen.

HTH

Kind Regards
Schalk
Volume4
www.volume4.co.za
Dedicated to an OpenSource World

Re: method of implementing a 'login' section in a site

Posted by Filip Hanik <ma...@filip.net>.
use the servlet specification way!!

ie, protect your pages with entries in web.xml
then tomcat will log in the users for you

Filip
----- Original Message ----- 
From: "zeallousbigpond.net.au" <ze...@bigpond.net.au>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, September 08, 2003 7:00 PM
Subject: method of implementing a 'login' section in a site


hi, 

    Thanks a lot for the email guys!! Another question I want to ask. I 
want to create a section of my site where I only allow users to use IF 
they have logged into my site. Either than using cookies to keep track 
if they have logged in or not, what method should I use to keep track 
of their status on each page?

Anson

----- Original Message -----
From: "Marco Tedone" <mt...@jemos.org>
Date: Tuesday, September 9, 2003 10:36 am
Subject: Re: EJB in tomcat

> Well, Tomcat needs to 'colloquiate' with an application server 
> (where EJBs
> are deployed). The answer is yes, it's possible; all your 
> application needs
> to do is to establish a context with an application server and 
> then it can
> use the component deployed on application server generally using a 
> lookup.
> Here follow a snippet from a code:
> 
> InitialContext context = null;
> //getJbossContext() sets up the correct property file and returns 
> a context
> initialized to that property file
> context = getJbossContext();
> Object node = context.lookup(sessionName);
> PeopleDbManagerHome home =
> (PeopleDbManagerHome)PortableRemoteObject.narrow(node,
> PeopleDbManagerHome.class);
> bean = home.create();
> } catch (RemoteException e) {
> printRemoteExceptionMessage();
> return null;
> }
> Hope it will help,
> 
> Marco
> 
> ----- Original Message ----- 
> From: "zeallousbigpond.net.au" <ze...@bigpond.net.au>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, September 09, 2003 1:17 AM
> Subject: EJB in tomcat
> 
> 
> > hi,
> >
> >      I would like to ask, can Tomcat work with Enterprise
> > Javabeans? 'cause I read from the Java site...it says that we 
> need a
> > BEA server? Is it necessary? Or tomcat it self already has those
> > libraries.
> >
> > Anson
> >
> >
> >
> > -----------------------------------------------------------------
> ----
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> 
> 
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
 


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



Re: Connetion between Tomcat & MySQL

Posted by Amy Cheung <ga...@yahoo.com>.
--- Bill Barker <wb...@wilshire.com> wrote:
> Assuming that you aren't using JDBCRealm, then it
> should be enough to put
> the jar file in $TOMCAT_HOME/lib/apps.  If you are
> using JDBCRealm, then
> place it in $TOMCAT_HOME/lib/common.
> 
> Setting the CLASSPATH is evil ;-).
> 
> "Amy Cheung" <ga...@yahoo.com> wrote in
> message
>
news:20030909034029.17718.qmail@web40708.mail.yahoo.com...
> > Hi,
> >
> > I am using Tomcat 3.3.1 and MySQL 4.0 in Window
> XP.
> > MySQL engine is running. When I run my jsp, it
> stated
> > the error that "import com.mysql.Driver" not
> found.
> > Anyone know how to install the driver properly? I
> read
> > something about setting the class path. But where
> to
> > set? I don't know much about the MSDOS command and
> > specify the envirnomental variables in Window XP.
> I
> > download both the J/Connector & OCBC driver from
> > MySQL. Where should be the exact location to
> store?
> >
> > Thanks,
> > Amy Cheung
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> > http://sitebuilder.yahoo.com
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Connector/J or ODBC?

Posted by Christopher Williams <cc...@ntlworld.com>.
Amy,

Always use a native JDBC driver if one is available:
1. The JDBC-ODBC bridge adds another layer of translation and redirection,
slowing down your database operations.
2. The JDBC-ODBC bridge seems kinda flaky.  I keep on getting errors staing
that "HRESULT is busy with another operation" when I use the bridge.

Chris.



Re: Connetion between Tomcat & MySQL

Posted by Amy Cheung <ga...@yahoo.com>.
OK. Thanks. It can connects to the database now. 

Here is a minor problem. The results I obtained from
the query is a ResultSet, rs. I keyed in this code:
while (rs.next())
{
System.out.print(rs.getString("RoomID");
}
In the Tomcat server, it printed the results that I
wanted. How to incorporate that results into the html
code to show on the web page? I tried but it's give me
error that cannot convert ResultSet into String.

Thanks,

Amy Cheung

--- Kwok Peng Tuck <pe...@makmal.net> wrote:
> Any JDBC driver for mysql (that works for you) will
> do.
> 
> Amy Cheung wrote:
> 
> >so what kind of connection is best? using the
> >J/Connector or the OCBC one?
> >
> >--- Bill Barker <wb...@wilshire.com> wrote:
> >  
> >
> >>Assuming that you aren't using JDBCRealm, then it
> >>should be enough to put
> >>the jar file in $TOMCAT_HOME/lib/apps.  If you are
> >>using JDBCRealm, then
> >>place it in $TOMCAT_HOME/lib/common.
> >>
> >>Setting the CLASSPATH is evil ;-).

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: Connetion between Tomcat & MySQL

Posted by Kwok Peng Tuck <pe...@makmal.net>.
Any JDBC driver for mysql (that works for you) will do.

Amy Cheung wrote:

>so what kind of connection is best? using the
>J/Connector or the OCBC one?
>
>--- Bill Barker <wb...@wilshire.com> wrote:
>  
>
>>Assuming that you aren't using JDBCRealm, then it
>>should be enough to put
>>the jar file in $TOMCAT_HOME/lib/apps.  If you are
>>using JDBCRealm, then
>>place it in $TOMCAT_HOME/lib/common.
>>
>>Setting the CLASSPATH is evil ;-).
>>
>>"Amy Cheung" <ga...@yahoo.com> wrote in
>>message
>>
>>    
>>
>news:20030909034029.17718.qmail@web40708.mail.yahoo.com...
>  
>
>>>Hi,
>>>
>>>I am using Tomcat 3.3.1 and MySQL 4.0 in Window
>>>      
>>>
>>XP.
>>    
>>
>>>MySQL engine is running. When I run my jsp, it
>>>      
>>>
>>stated
>>    
>>
>>>the error that "import com.mysql.Driver" not
>>>      
>>>
>>found.
>>    
>>
>>>Anyone know how to install the driver properly? I
>>>      
>>>
>>read
>>    
>>
>>>something about setting the class path. But where
>>>      
>>>
>>to
>>    
>>
>>>set? I don't know much about the MSDOS command and
>>>specify the envirnomental variables in Window XP.
>>>      
>>>
>>I
>>    
>>
>>>download both the J/Connector & OCBC driver from
>>>MySQL. Where should be the exact location to
>>>      
>>>
>>store?
>>    
>>
>>>Thanks,
>>>Amy Cheung
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Yahoo! SiteBuilder - Free, easy-to-use web site
>>>      
>>>
>>design software
>>    
>>
>>>http://sitebuilder.yahoo.com
>>>      
>>>
>>
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>tomcat-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>http://sitebuilder.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


Re: Connetion between Tomcat & MySQL

Posted by Amy Cheung <ga...@yahoo.com>.
so what kind of connection is best? using the
J/Connector or the OCBC one?

--- Bill Barker <wb...@wilshire.com> wrote:
> Assuming that you aren't using JDBCRealm, then it
> should be enough to put
> the jar file in $TOMCAT_HOME/lib/apps.  If you are
> using JDBCRealm, then
> place it in $TOMCAT_HOME/lib/common.
> 
> Setting the CLASSPATH is evil ;-).
> 
> "Amy Cheung" <ga...@yahoo.com> wrote in
> message
>
news:20030909034029.17718.qmail@web40708.mail.yahoo.com...
> > Hi,
> >
> > I am using Tomcat 3.3.1 and MySQL 4.0 in Window
> XP.
> > MySQL engine is running. When I run my jsp, it
> stated
> > the error that "import com.mysql.Driver" not
> found.
> > Anyone know how to install the driver properly? I
> read
> > something about setting the class path. But where
> to
> > set? I don't know much about the MSDOS command and
> > specify the envirnomental variables in Window XP.
> I
> > download both the J/Connector & OCBC driver from
> > MySQL. Where should be the exact location to
> store?
> >
> > Thanks,
> > Amy Cheung
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> > http://sitebuilder.yahoo.com
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: Connetion between Tomcat & MySQL

Posted by Bill Barker <wb...@wilshire.com>.
Assuming that you aren't using JDBCRealm, then it should be enough to put
the jar file in $TOMCAT_HOME/lib/apps.  If you are using JDBCRealm, then
place it in $TOMCAT_HOME/lib/common.

Setting the CLASSPATH is evil ;-).

"Amy Cheung" <ga...@yahoo.com> wrote in message
news:20030909034029.17718.qmail@web40708.mail.yahoo.com...
> Hi,
>
> I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP.
> MySQL engine is running. When I run my jsp, it stated
> the error that "import com.mysql.Driver" not found.
> Anyone know how to install the driver properly? I read
> something about setting the class path. But where to
> set? I don't know much about the MSDOS command and
> specify the envirnomental variables in Window XP. I
> download both the J/Connector & OCBC driver from
> MySQL. Where should be the exact location to store?
>
> Thanks,
> Amy Cheung
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com




RE: Connetion between Tomcat & MySQL

Posted by Mike Curwen <gb...@gb-im.com>.
That's just not good advice at all.  I don't know where people get the
idea of touching CLASSPATH when they're talking about Tomcat and
web-apps in general.
 
Drivers should be placed in common/lib or WEB-INF/lib.  That's IT.  
 
And mm.mysql.driver?  

You  mean: 

com.mysql.jdbc.Driver 

 
And one last rant, as Chris Williams started to point out... ODBC is a
Microsoft data access abstraction layer. 

ODBC = Microsoft Way of doing it
JDBC = Java way of doing it

So you'd only download or use the ODBC driver if you were accessing
MySql from a VB or C# program.

> -----Original Message-----
> From: Schalk [mailto:schalk@volume4.co.za] 
> Sent: Tuesday, September 09, 2003 6:20 AM
> To: Tomcat Users List
> Subject: Re: Connetion between Tomcat & MySQL
> 
> 
> There is two things you can do. Set your CLASSPATH to include 
> mm.mysql.driver and include the jar in your webapps lib folder.
> 
> HTH
> 
> Kind Regards
> Schalk
> Volume4
> 


Re: Connetion between Tomcat & MySQL

Posted by Schalk <sc...@volume4.co.za>.
There is two things you can do. Set your CLASSPATH to include mm.mysql.driver and include the jar in your webapps lib folder.

HTH

Kind Regards
Schalk
Volume4

Re: Connetion between Tomcat & MySQL

Posted by Marco Tedone <mt...@jemos.org>.
You may want to put the JDBC driver jar file under %TOMCAT_HOME%/common/lib
and try again. This is the location where the classloader loads the classes
which makes available to all Tomcat applications.

Marco
----- Original Message ----- 
From: "Amy Cheung" <ga...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, September 09, 2003 4:40 AM
Subject: Connetion between Tomcat & MySQL


> Hi,
>
> I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP.
> MySQL engine is running. When I run my jsp, it stated
> the error that "import com.mysql.Driver" not found.
> Anyone know how to install the driver properly? I read
> something about setting the class path. But where to
> set? I don't know much about the MSDOS command and
> specify the envirnomental variables in Window XP. I
> download both the J/Connector & OCBC driver from
> MySQL. Where should be the exact location to store?
>
> Thanks,
> Amy Cheung
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>




Re: Connetion between Tomcat & MySQL

Posted by Christopher Williams <cc...@ntlworld.com>.
I'll assume that you're using Connector /J.  Stick the file
mysql-connector-java-x.y.zz-bin.jar (where "x.y.zz" is the version number)
in Tomcat's common/lib directory.



Re: Connetion between Tomcat & MySQL

Posted by Christopher Williams <cc...@ntlworld.com>.
My apologies (and my tping error), the directory should be "common/lib", not
"lib/common".



Connetion between Tomcat & MySQL

Posted by Amy Cheung <ga...@yahoo.com>.
Hi,

I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP.
MySQL engine is running. When I run my jsp, it stated
the error that "import com.mysql.Driver" not found.
Anyone know how to install the driver properly? I read
something about setting the class path. But where to
set? I don't know much about the MSDOS command and
specify the envirnomental variables in Window XP. I
download both the J/Connector & OCBC driver from
MySQL. Where should be the exact location to store?

Thanks,
Amy Cheung

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

RE: method of implementing a 'login' section in a site

Posted by Anson Zeall <ze...@bigpond.net.au>.
I don't get it....you mean you have to can set the cookie yourself??

-----Original Message-----
From: Billy Kantartzis [mailto:billy@vknet.net]
Sent: Tuesday, September 09, 2003 8:41 PM
To: Tomcat Users List
Subject: Re: method of implementing a 'login' section in a site


The way i prefer to do it is use a simple db with the
user atributes (userid , password , etc), use cookies
to check if the user is logged in or not.

one thing i had problems with when i first implemented
this solution is that the cookies are stored in a
browser specific place and you might not be able to
access them easilly. a work round to this is to set
the cookie path yourself from a methid in the API (i
dont have it at the top of my head i will look it up)
and get the cookie reference using the location where
the cookie is stored

Billy


--- "zeallousbigpond.net.au" <ze...@bigpond.net.au>
wrote:
> hi,
>
>     Thanks a lot for the email guys!! Another
> question I want to ask. I
> want to create a section of my site where I only
> allow users to use IF
> they have logged into my site. Either than using
> cookies to keep track
> if they have logged in or not, what method should I
> use to keep track
> of their status on each page?
>
> Anson
>
> ----- Original Message -----
> From: "Marco Tedone" <mt...@jemos.org>
> Date: Tuesday, September 9, 2003 10:36 am
> Subject: Re: EJB in tomcat
>
> > Well, Tomcat needs to 'colloquiate' with an
> application server
> > (where EJBs
> > are deployed). The answer is yes, it's possible;
> all your
> > application needs
> > to do is to establish a context with an
> application server and
> > then it can
> > use the component deployed on application server
> generally using a
> > lookup.
> > Here follow a snippet from a code:
> >
> > InitialContext context = null;
> > //getJbossContext() sets up the correct property
> file and returns
> > a context
> > initialized to that property file
> > context = getJbossContext();
> > Object node = context.lookup(sessionName); PeopleDbManagerHome home
> > =
> >
>
(PeopleDbManagerHome)PortableRemoteObject.narrow(node,
> > PeopleDbManagerHome.class);
> > bean = home.create();
> > } catch (RemoteException e) { printRemoteExceptionMessage();
> > return null;
> > }
> > Hope it will help,
> >
> > Marco
> >
> > ----- Original Message -----
> > From: "zeallousbigpond.net.au"
> <ze...@bigpond.net.au>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, September 09, 2003 1:17 AM
> > Subject: EJB in tomcat
> >
> >
> > > hi,
> > >
> > >      I would like to ask, can Tomcat work with
> Enterprise
> > > Javabeans? 'cause I read from the Java site...it
> says that we
> > need a
> > > BEA server? Is it necessary? Or tomcat it self
> already has those
> > > libraries.
> > >
> > > Anson
> > >
> > >
> > >
> > >
>
-----------------------------------------------------------------
> > ----
> > > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> >
> >
> >
>
-------------------------------------------------------------------
> > --
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>


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



Re: method of implementing a 'login' section in a site

Posted by Billy Kantartzis <bi...@vknet.net>.
The way i prefer to do it is use a simple db with the
user atributes (userid , password , etc), use cookies
to check if the user is logged in or not.

one thing i had problems with when i first implemented
this solution is that the cookies are stored in a
browser specific place and you might not be able to
access them easilly. a work round to this is to set
the cookie path yourself from a methid in the API (i
dont have it at the top of my head i will look it up)
and get the cookie reference using the location where
the cookie is stored

Billy 


--- "zeallousbigpond.net.au" <ze...@bigpond.net.au>
wrote:
> hi, 
> 
>     Thanks a lot for the email guys!! Another
> question I want to ask. I 
> want to create a section of my site where I only
> allow users to use IF 
> they have logged into my site. Either than using
> cookies to keep track 
> if they have logged in or not, what method should I
> use to keep track 
> of their status on each page?
> 
> Anson
> 
> ----- Original Message -----
> From: "Marco Tedone" <mt...@jemos.org>
> Date: Tuesday, September 9, 2003 10:36 am
> Subject: Re: EJB in tomcat
> 
> > Well, Tomcat needs to 'colloquiate' with an
> application server 
> > (where EJBs
> > are deployed). The answer is yes, it's possible;
> all your 
> > application needs
> > to do is to establish a context with an
> application server and 
> > then it can
> > use the component deployed on application server
> generally using a 
> > lookup.
> > Here follow a snippet from a code:
> > 
> > InitialContext context = null;
> > //getJbossContext() sets up the correct property
> file and returns 
> > a context
> > initialized to that property file
> > context = getJbossContext();
> > Object node = context.lookup(sessionName);
> > PeopleDbManagerHome home =
> >
>
(PeopleDbManagerHome)PortableRemoteObject.narrow(node,
> > PeopleDbManagerHome.class);
> > bean = home.create();
> > } catch (RemoteException e) {
> > printRemoteExceptionMessage();
> > return null;
> > }
> > Hope it will help,
> > 
> > Marco
> > 
> > ----- Original Message ----- 
> > From: "zeallousbigpond.net.au"
> <ze...@bigpond.net.au>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, September 09, 2003 1:17 AM
> > Subject: EJB in tomcat
> > 
> > 
> > > hi,
> > >
> > >      I would like to ask, can Tomcat work with
> Enterprise
> > > Javabeans? 'cause I read from the Java site...it
> says that we 
> > need a
> > > BEA server? Is it necessary? Or tomcat it self
> already has those
> > > libraries.
> > >
> > > Anson
> > >
> > >
> > >
> > >
>
-----------------------------------------------------------------
> > ----
> > > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > >
> > 
> > 
> > 
> > 
> >
>
-------------------------------------------------------------------
> > --
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > 
> > 
>  
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>