This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes configurate filter mapping to different servlet and action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "configurate filter mapping to different servlet and action" Watch "configurate filter mapping to different servlet and action" New topic
Author

configurate filter mapping to different servlet and action

Haulyn Jason
Ranch Hand

Joined: Jul 24, 2007
Posts: 37
Hi, all:

I have to maintain a legacy projet, it's based on struts and servlet. All the path is configurate to root, like: /userLogin /membreLogin /other.
And, there are two different member system, I mean that, I want a filter mapping to :/a.do /b.do /c.do, another filter mapping to /e.do /f.do and /h.do. Is it possible? I have more than 10000 actions!

I'd like to configurate in web.xml, but I do not know how can my filter seperate different actions?

Thanks!


Mama always said, "Life is like a box of chocolates; you never know what you're gonna get. And then you have to get medieval on somebody's buttocks."
http://www.haulynjason.net/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

"sahara bear", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Haulyn Jason
Ranch Hand

Joined: Jul 24, 2007
Posts: 37
Oh, I am sorry about that!
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You need a FrontController, which you would need for actions anyway.

You map the Front Controller once, eg to /*.do and then it receives requests and redirects to the required Action. @see Struts.
Haulyn Jason
Ranch Hand

Joined: Jul 24, 2007
Posts: 37
Thanks very much, I find it's impossible to do what I want. Now I create a filterService, and invoke the filterService.check(request) in the filter. then configurate actions in an xml file.
it works well.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Are you going to correct your display name?
Haulyn Jason
Ranch Hand

Joined: Jul 24, 2007
Posts: 37
I am not sure is it ok now? I changed my profile. I am sorry.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
The name is fine now, thanks.


Ping & DNS - my free Android networking tools app
Haulyn Jason
Ranch Hand

Joined: Jul 24, 2007
Posts: 37
I am sorry for my mistake,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: configurate filter mapping to different servlet and action