Re: Authorization Filter in Tapestry ?

2007-01-19 Thread andyhot

Not sure, but why not implement
org.apache.tapestry.services.ServletRequestServicerFilter instead of 
WebRequestServicerFilter


and contribute to ServletRequestServicer



sunilmanu wrote:

Yes, i do contribute filter to WebRequestServicer. I got it working looking
at another example posted in the forum.

But now the question is how do I redirect to Login Page when I find out no
user exists in session ?

the tapestry WebResponse does not have any "sendRedirect" like we have in
the normal HttpResponse object.

1) I tried casting it -> gave me an error saying it cannot be cast.
2) throwing new PageRedirectiopn also does not work !

whats the solution I can use to  redirect to another Tapestry page in this
situation ??

Thanks in advance..

- Sunil


andyhot wrote:
  

Check out the conf.points of tapestry.request
http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/module/tapestry.request.html

Did you contribute your filter to the WebRequestServicer Pipeline ?

sunilmanu wrote:


Hello Everyone,

I want to implement an Authorization Filter in Tapestry that simply
checks
for the Logged In USER in Session,.

public class AuthorizationFilter  implements WebRequestServicerFilter{
	 
public void service(WebRequest request, WebResponse response,	
			 WebRequestServicer servicer) throws IOException {	  
 if (user exists)

 {
  //then process
 }
  else
  {
  //redirect to Loginpage.
 }


---hivemodule.xml---
interface="org.apache.tapestry.services.WebRequestServicerFilter"> 		   

		   
	   
 


Above is my code but somehow filter is not intercepting the request.What
wrong am i doing ? Can someone point to a working example ?

We are short on time for implementing the AcegiSecurity, so we decided to
go
with the Filter initially and later add Acegi.


Thanks,
Sunil
  
  

--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  



--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Authorization Filter in Tapestry ?

2007-01-19 Thread sunilmanu

Yes, i do contribute filter to WebRequestServicer. I got it working looking
at another example posted in the forum.

But now the question is how do I redirect to Login Page when I find out no
user exists in session ?

the tapestry WebResponse does not have any "sendRedirect" like we have in
the normal HttpResponse object.

1) I tried casting it -> gave me an error saying it cannot be cast.
2) throwing new PageRedirectiopn also does not work !

whats the solution I can use to  redirect to another Tapestry page in this
situation ??

Thanks in advance..

- Sunil


andyhot wrote:
> 
> Check out the conf.points of tapestry.request
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/module/tapestry.request.html
> 
> Did you contribute your filter to the WebRequestServicer Pipeline ?
> 
> sunilmanu wrote:
>> Hello Everyone,
>>
>> I want to implement an Authorization Filter in Tapestry that simply
>> checks
>> for the Logged In USER in Session,.
>>
>> public class AuthorizationFilter  implements WebRequestServicerFilter{
>>   
>> public void service(WebRequest request, WebResponse response,
>>   WebRequestServicer servicer) throws IOException {  
>>   
>>  if (user exists)
>>  {
>>   //then process
>>  }
>>   else
>>   {
>>   //redirect to Loginpage.
>>  }
>>
>>
>> ---hivemodule.xml---
>> > interface="org.apache.tapestry.services.WebRequestServicerFilter">   
>>
>> 
>>  
>>
>>  
>>
>> Above is my code but somehow filter is not intercepting the request.What
>> wrong am i doing ? Can someone point to a working example ?
>>
>> We are short on time for implementing the AcegiSecurity, so we decided to
>> go
>> with the Filter initially and later add Acegi.
>>
>>
>> Thanks,
>> Sunil
>>   
> 
> 
> -- 
> Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE Consulting 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Authorization-Filter-in-Tapestry---tf3034967.html#a8454076
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Authorization Filter in Tapestry ?

2007-01-19 Thread andyhot

Check out the conf.points of tapestry.request
http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/module/tapestry.request.html

Did you contribute your filter to the WebRequestServicer Pipeline ?

sunilmanu wrote:

Hello Everyone,

I want to implement an Authorization Filter in Tapestry that simply checks
for the Logged In USER in Session,.

public class AuthorizationFilter  implements WebRequestServicerFilter{
	 
public void service(WebRequest request, WebResponse response,	
			 WebRequestServicer servicer) throws IOException {	  
 if (user exists)

 {
  //then process
 }
  else
  {
  //redirect to Loginpage.
 }


---hivemodule.xml---
interface="org.apache.tapestry.services.WebRequestServicerFilter"> 		   

		   
	   
 


Above is my code but somehow filter is not intercepting the request.What
wrong am i doing ? Can someone point to a working example ?

We are short on time for implementing the AcegiSecurity, so we decided to go
with the Filter initially and later add Acegi.


Thanks,
Sunil
  



--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Authorization Filter in Tapestry ?

2007-01-18 Thread sunilmanu

Hello Everyone,

I want to implement an Authorization Filter in Tapestry that simply checks
for the Logged In USER in Session,.

public class AuthorizationFilter  implements WebRequestServicerFilter{
 
public void service(WebRequest request, WebResponse response,   
 WebRequestServicer servicer) throws IOException {  
  
 if (user exists)
 {
  //then process
 }
  else
  {
  //redirect to Loginpage.
 }


---hivemodule.xml---
  
   


  
 

Above is my code but somehow filter is not intercepting the request.What
wrong am i doing ? Can someone point to a working example ?

We are short on time for implementing the AcegiSecurity, so we decided to go
with the Filter initially and later add Acegi.


Thanks,
Sunil
-- 
View this message in context: 
http://www.nabble.com/Authorization-Filter-in-Tapestry---tf3034967.html#a8433506
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]