This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56191
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 35241
    
    7
The name is fine now, thanks.


Android appsImageJ pluginsJava web charts
Haulyn Jason
Ranch Hand

Joined: Jul 24, 2007
Posts: 37
I am sorry for my mistake,
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: configurate filter mapping to different servlet and action
 
Similar Threads
Problem with configurate Spring and Hibernate
order of filter mapping
How to install and configurate Apache and Tomcat?
using filters with struts
Hard to configurate Hibernate using NetBeans 5.5.1