File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How I can cut the communication between client and server using a filter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How I can cut the communication between client and server using a filter?" Watch "How I can cut the communication between client and server using a filter?" New topic
Author

How I can cut the communication between client and server using a filter?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Hi
Thank you for reading my post
How I can cut the communication between client and server using a filter?
for example if user request header has no coockie, i do not allow the request to go to its endpoint and instead i generate some html and send it as response to the client without allowing the request to go in.

Thank you very much.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Write a filter that checks for the cookie and forwards to an error or login page if the cookie is not present.
If the cookie is present, call chain.doFilter.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Hi
Thank you for your reply.
I want the filter to write something in the output instead of redirecting to some other pages.
Is it possible?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How I can cut the communication between client and server using a filter?
 
Similar Threads
java mail
Do I need a separate Web Client?
read from httpRequest put into httpResponse in Filter?
How to configure Tomcat to log POST data?
terminate a client in between the communication with server when a condition is met.