Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Term "URL.endWith" is Filter does not work  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
   Hey all!

I try to realize the following scheme:
1. From url “http://localhost:8080/newsPage?role=manager” or “http://localhost:8080/newsPage?role=spec”  I send the request to Servlet “/newsPage”.    Interaction between client and servlet is serviced through  Jsp “newPage.jsp”.  
2. All requests to servlet “/newsPage”  have to be passed through filter “FilterLogin”. In this filter I use the term: “if (url.endsWith(“manager”))” or “if (url.endsWith(“spec”))”.
But this term does not work. I may sure in this problem, by using Logger.info (in particular).

The Filter-code:


  Post-method is realized in client, when url "http://localhost:8080/newsPage?role=manager",
  by the form-construction in jsp-page:



  To make the problem-understanding more easy, I attached the general diagram to my post.

GeneralLogic.png
[Thumbnail for GeneralLogic.png]
 
Saloon Keeper
Posts: 2406
296
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Andrey Dmitriev wrote:


Have you verified that session is actually equal to null?
 
Andrey Dmitriev
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Andrey Dmitriev wrote:


Have you verified that session is actually equal to null?



 No, I have not. From other side, when I except "(session == null)" and retain only "(uri.endsWith("manager")" noting is changing.
 
ice is for people that are not already cool. Chill with this tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!