You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pritpal Dhaliwal <ps...@ucdavis.edu> on 2001/11/15 07:13:06 UTC

Authentication Filter

Is there an authentication filter that could be used with Servlet Spec 2.3.
Does tomcat 4 come with one that could be used?

Thanks in Advance,

Pritpal Dhaliwal


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Authentication Filter Posting Again

Posted by Barry White <ba...@charter.net>.
I would have responded had I known the answer... I have never worked with
filters.
Try searching for authentication filters in the archives.


----- Original Message -----
From: "Pritpal Dhaliwal" <ps...@ucdavis.edu>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, November 16, 2001 4:48 AM
Subject: Re: Authentication Filter Posting Again


> I am posting this again because no one responded.  No one here has worked
> with filters? Can I get a yes or no about if Tomcat has a Authentication
> filter?
>
> Thanks in Advance,
>
> Pritpal Dhaliwal
> ----- Original Message -----
> From: "Pritpal Dhaliwal" <ps...@ucdavis.edu>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Wednesday, November 14, 2001 10:13 PM
> Subject: Authentication Filter
>
>
> > Is there an authentication filter that could be used with Servlet Spec
> 2.3.
> > Does tomcat 4 come with one that could be used?
> >
> > Thanks in Advance,
> >
> > Pritpal Dhaliwal
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Authentication Filter Posting Again

Posted by "Craig R. McClanahan" <cr...@apache.org>.
I answered this yesterday ... go check the archives of this mailing list.

Craig


On Fri, 16 Nov 2001, Pritpal Dhaliwal wrote:

> Date: Fri, 16 Nov 2001 01:48:20 -0800
> From: Pritpal Dhaliwal <ps...@ucdavis.edu>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: Authentication Filter Posting Again
>
> I am posting this again because no one responded.  No one here has worked
> with filters? Can I get a yes or no about if Tomcat has a Authentication
> filter?
>
> Thanks in Advance,
>
> Pritpal Dhaliwal
> ----- Original Message -----
> From: "Pritpal Dhaliwal" <ps...@ucdavis.edu>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Wednesday, November 14, 2001 10:13 PM
> Subject: Authentication Filter
>
>
> > Is there an authentication filter that could be used with Servlet Spec
> 2.3.
> > Does tomcat 4 come with one that could be used?
> >
> > Thanks in Advance,
> >
> > Pritpal Dhaliwal
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Authentication Filter Posting Again

Posted by Pritpal Dhaliwal <ps...@ucdavis.edu>.
I am posting this again because no one responded.  No one here has worked
with filters? Can I get a yes or no about if Tomcat has a Authentication
filter?

Thanks in Advance,

Pritpal Dhaliwal
----- Original Message -----
From: "Pritpal Dhaliwal" <ps...@ucdavis.edu>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, November 14, 2001 10:13 PM
Subject: Authentication Filter


> Is there an authentication filter that could be used with Servlet Spec
2.3.
> Does tomcat 4 come with one that could be used?
>
> Thanks in Advance,
>
> Pritpal Dhaliwal
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Authentication Filter

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 14 Nov 2001, Pritpal Dhaliwal wrote:

> Date: Wed, 14 Nov 2001 22:13:06 -0800
> From: Pritpal Dhaliwal <ps...@ucdavis.edu>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Authentication Filter
>
> Is there an authentication filter that could be used with Servlet Spec 2.3.

You could certainly use a filter to write your own authentication support.

> Does tomcat 4 come with one that could be used?

Tomcat 4 supports standard container-managed security, but it is not done
with Filters.  You could write your own, however, along the following
lines:

* Map your filter to URL pattern "/*" so that it sees all the
  requests to this application.

* Check if the user has already logged on, by looking
  for an object in the user's session.

* If the user is logged on already, go ahead and pass
  the request on to whatever they asked for.  (You will also
  want to let them see the login page itself, so that they
  actually can log in.)

* If the user is not logged in, do a RequestDispatcher.forward()
  to the login page and then return without passing the request on.

* In your login processing, create the appropriate object
  in the user's session so that the next request
  will find it there.

There's lots of variations on this theme, depending on precisely how you
want to authenticate people.

>
> Thanks in Advance,
>
> Pritpal Dhaliwal
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Servlet Mapping...:(

Posted by Pritpal Dhaliwal <ps...@ucdavis.edu>.
You were lucky in the first one, second one, luck wasn't there.


----- Original Message -----
From: "BacardiWasabi" <se...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, November 14, 2001 11:02 PM
Subject: Servlet Mapping...:(


> time for a silly question...
>
>
>
> file - web.xml
>
>
> <servlet>
>             <servlet-name>TestAction</servlet-name>
>             <servlet-class>ActionServlet</servlet-class>
> </servlet>
>
>
> <servlet-mapping>
>             <servlet-name>TestAction</servlet-name>
>             <url-pattern>/TestAction</url-pattern>
> </servlet-mapping>
>
Over here, you mapped the   /servlet/TestAction to /TestAction,
so it is availble at both /servlet/TestAction and /TestAction URL
>
> ActionServlet - web-inf\classes
>
> Context path - framework
>
> a) when my url is
> http:...:8080/framework/servlet/TestAction - it is
> working fine
>
> b) but when i make change to servlet mapping to above
> web.xml as
>
> <servlet-mapping>
>             <servlet-name>TestAction</servlet-name>
>             <url-pattern>/action</url-pattern>
>     </servlet-mapping>
>

Over here, you mapped the   /servlet/TestAction to /action
,
so it is availble at both /servlet/TestAction and /action URL


>
> and invoke
> http:...:8080/framwork/servlet/action - im getting
> page cannot be found

so you should access it using /framework/action

You mapped the URL but you are not trying to use the power of mapped URLs.
I don't think youi need to map any url if you want to access them using
/servlet/ClassName

something its good to map a servlet name to a class name when say class name
is   com.pritpal.dhaliwal.mother.s.lastname.RealClassName
to RealClassName
so you would do it like this:

 <servlet>
             <servlet-name>RealClassName</servlet-name>
             <servlet-class>
com.pritpal.dhaliwal.mother.s.lastname.RealClassName </servlet-class>
 </servlet>

Above you had:
> <servlet>
>             <servlet-name>TestAction</servlet-name>
>             <servlet-class>ActionServlet</servlet-class>
> </servlet>

which ofcourse works, but again, you are not using power of mapping class
name to servlet names.
( its not same as mapping servlet names to URLs, just to make sure)



> restarted my server...


Regards,

Pritpal Dhaliwal


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Servlet Mapping...:(

Posted by BacardiWasabi <se...@yahoo.com>.
I completely understand that my URL should be

http://localhost:8080/framework/action

not 

http://localhost:8080/framework/servlet/action for
below web.xml

web.xml

<servlet-name>TestAction</servlet-name>
 <servlet-class>ActionServlet</servlet-class>
 </servlet>

<servlet-mapping>
            
<servlet-name>TestAction</servlet-name>
<url-pattern>/TestAction</url-pattern>
</servlet-mapping>

My ActionServlet servlet class resides under
web-inf/classes.

I still dont understand ...why im getting "Page Cannot
be Found" error page when i access servlet like

http://localhost:8080/framwork/TestAction

Is there any other change that i should make apart
from web.xml?

servlet is not in any package. Im placing it under
classes folder.



--- "Craig R. McClanahan" <cr...@apache.org> wrote:
> With the servlet mapping you've defined, the correct
> URL is:
> 
>   http://localhost:8080/framework/action
> 
> not
> 
>   http://localhost:8080/framework/servlet/action
> 
> Craig
> 
> 
> On Wed, 14 Nov 2001, BacardiWasabi wrote:
> 
> > Date: Wed, 14 Nov 2001 23:02:57 -0800 (PST)
> > From: BacardiWasabi <se...@yahoo.com>
> > Reply-To: Tomcat Users List
> <to...@jakarta.apache.org>
> > To: Tomcat Users List
> <to...@jakarta.apache.org>
> > Subject: Servlet Mapping...:(
> >
> > time for a silly question...
> >
> >
> >
> > file - web.xml
> >
> >
> > <servlet>
> >            
> <servlet-name>TestAction</servlet-name>
> >
> > <servlet-class>ActionServlet</servlet-class>
> > </servlet>
> >
> >
> > <servlet-mapping>
> >            
> <servlet-name>TestAction</servlet-name>
> >             <url-pattern>/TestAction</url-pattern>
> >     </servlet-mapping>
> >
> >
> > ActionServlet - web-inf\classes
> >
> > Context path - framework
> >
> > a) when my url is
> > http:...:8080/framework/servlet/TestAction - it is
> > working fine
> >
> > b) but when i make change to servlet mapping to
> above
> > web.xml as
> >
> > <servlet-mapping>
> >            
> <servlet-name>TestAction</servlet-name>
> >             <url-pattern>/action</url-pattern>
> >     </servlet-mapping>
> >
> >
> >
> > and invoke
> > http:...:8080/framwork/servlet/action - im getting
> > page cannot be found
> >
> > restarted my server...
> >
> >
> >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Find the one for you at Yahoo! Personals
> > http://personals.yahoo.com
> >
> > --
> > To unsubscribe:  
> <ma...@jakarta.apache.org>
> > For additional commands:
> <ma...@jakarta.apache.org>
> > Troubles with the list:
> <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe:  
> <ma...@jakarta.apache.org>
> For additional commands:
> <ma...@jakarta.apache.org>
> Troubles with the list:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Servlet Mapping...:(

Posted by "Craig R. McClanahan" <cr...@apache.org>.
With the servlet mapping you've defined, the correct URL is:

  http://localhost:8080/framework/action

not

  http://localhost:8080/framework/servlet/action

Craig


On Wed, 14 Nov 2001, BacardiWasabi wrote:

> Date: Wed, 14 Nov 2001 23:02:57 -0800 (PST)
> From: BacardiWasabi <se...@yahoo.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Servlet Mapping...:(
>
> time for a silly question...
>
>
>
> file - web.xml
>
>
> <servlet>
>             <servlet-name>TestAction</servlet-name>
>
> <servlet-class>ActionServlet</servlet-class>
> </servlet>
>
>
> <servlet-mapping>
>             <servlet-name>TestAction</servlet-name>
>             <url-pattern>/TestAction</url-pattern>
>     </servlet-mapping>
>
>
> ActionServlet - web-inf\classes
>
> Context path - framework
>
> a) when my url is
> http:...:8080/framework/servlet/TestAction - it is
> working fine
>
> b) but when i make change to servlet mapping to above
> web.xml as
>
> <servlet-mapping>
>             <servlet-name>TestAction</servlet-name>
>             <url-pattern>/action</url-pattern>
>     </servlet-mapping>
>
>
>
> and invoke
> http:...:8080/framwork/servlet/action - im getting
> page cannot be found
>
> restarted my server...
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Servlet Mapping...:(

Posted by BacardiWasabi <se...@yahoo.com>.
time for a silly question...



file - web.xml


<servlet>
            <servlet-name>TestAction</servlet-name>
           
<servlet-class>ActionServlet</servlet-class>
</servlet>


<servlet-mapping>
            <servlet-name>TestAction</servlet-name>
            <url-pattern>/TestAction</url-pattern>  
    </servlet-mapping>


ActionServlet - web-inf\classes

Context path - framework

a) when my url is
http:...:8080/framework/servlet/TestAction - it is
working fine

b) but when i make change to servlet mapping to above
web.xml as

<servlet-mapping>
            <servlet-name>TestAction</servlet-name>
            <url-pattern>/action</url-pattern>  
    </servlet-mapping>



and invoke
http:...:8080/framwork/servlet/action - im getting
page cannot be found

restarted my server...






__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>