RE: Wildcard-matched actions (again)
I haven't actually look at the code yet, but as I understand it, wildcards are not even considered unless no other match is found. In which case you would be getting an error page anyway. So I don't think there's any performance impact... unless you're in a hurry to see that error page :-) Steve -Original Message- From: Robert Leland [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 7:41 PM To: Struts Developers List Subject: Re: Wildcard-matched actions (again) Don Brown wrote: Heh, thankfully no. :) In fact, that's one of the reasons I'd like to incorporate this into Struts itself to remove that alternate processor requirement. The patch adds a couple of lines to RequestProcessor.processMapping() to, in the case of no direct mapping found, try to match any wildcards. All of the logic of wildcard mapping is stored in a helper class to keep RequestProcessor as clean as possible. Don How about an option to turn it off ? Having something infinitely configurable is good right ;-) ! But seriously, if there will be noticeable overhead the ability should be able to be turned off. In fact once struts configuration is frozen then it should be able to detect whether it needs to search for wild card matches or not. -Rob -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
Heh, thankfully no. :) In fact, that's one of the reasons I'd like to incorporate this into Struts itself to remove that alternate processor requirement. The patch adds a couple of lines to RequestProcessor.processMapping() to, in the case of no direct mapping found, try to match any wildcards. All of the logic of wildcard mapping is stored in a helper class to keep RequestProcessor as clean as possible. Don On Mon, 11 Aug 2003, David Graham wrote: --- Don Brown [EMAIL PROTECTED] wrote: I'd like to put the wildcard-matched action code from Bug #21813 (http://issues.apache.org/bugzilla/show_bug.cgi?id=21813) into Struts. When I mentioned it last, the only concern I heard raised was from Craig regarding performance penalties. As I noted in the bug description, the path isn't checked against compiled wildcards until an exact match cannot be found. Even then, it is only checked against action mappings that actually contain at least one wildcard. Let me know if anyone has any reason I shouldn't do this or concerns I can hopefully alleviate. Thanks. Looks pretty neat. On your site you have a custom WildcardRequestProcessor that performs this behavior. Are you planning on incorporating it directly into RequestProcessor now? I don't think we should exasperate the poor RequestProcessor situation any further by adding more of them. David Don - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Wildcard-matched actions (again)
On Mon, 11 Aug 2003, Steve Raeburn wrote: Date: Mon, 11 Aug 2003 19:55:14 -0700 From: Steve Raeburn [EMAIL PROTECTED] Reply-To: Struts Developers List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Struts Developers List [EMAIL PROTECTED] Subject: RE: Wildcard-matched actions (again) I haven't actually look at the code yet, but as I understand it, wildcards are not even considered unless no other match is found. In which case you would be getting an error page anyway. If that's the way it actually works (and I believe this was the original proposal), I'm ok with it -- the only potential performance impact for existing users would be those who rely on the default action capability to handle lots of requests, and that seems pretty unlikely. So I don't think there's any performance impact... unless you're in a hurry to see that error page :-) Steve Craig -Original Message- From: Robert Leland [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 7:41 PM To: Struts Developers List Subject: Re: Wildcard-matched actions (again) Don Brown wrote: Heh, thankfully no. :) In fact, that's one of the reasons I'd like to incorporate this into Struts itself to remove that alternate processor requirement. The patch adds a couple of lines to RequestProcessor.processMapping() to, in the case of no direct mapping found, try to match any wildcards. All of the logic of wildcard mapping is stored in a helper class to keep RequestProcessor as clean as possible. Don How about an option to turn it off ? Having something infinitely configurable is good right ;-) ! But seriously, if there will be noticeable overhead the ability should be able to be turned off. In fact once struts configuration is frozen then it should be able to detect whether it needs to search for wild card matches or not. -Rob -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
If performance is not affected, then there is indeed no need to turn this feature off. Don Brown wrote: I apologize if I wasn't clear; there is absolutely no performance penalty for any existing or future Struts applications that do not use wildcards. Upon initialization of the RequestProcessor, it runs through each action mapping to see if any of them use wildcards. Only if a wildcard is found in the path attribute, the path value is compiled and added to a list of expressions to test. Therefore, if wildcards aren't used at all, this feature is completely ignored. When processMapping() is called, the path is tested against compiled wildcards only if the following requirements are NOT met: 1) There is no direct match for the path (usual Struts behavior) 2) There is at least one action mapping that uses wildcards Therefore, even if your entire application relies on the default action mapping, if you are not using wildcards, your application will suffer no penalty. As for putting it in post-1.2.0, that is fine. I've been using the code for over a month in my day job's application and it has been in stxx (http://stxx.sf.net) for as long. Furthermore, the core of it comes from Cocoon and forms the basis for how pipelines are matched in their sitemap. In my application, it cut the number of action mappings by 66% making Struts tons more manageable. But again, its completely optional and doesn't affect anyone who doesn't use wildcards. Don On Tue, 12 Aug 2003, David Graham wrote: --- Robert Leland [EMAIL PROTECTED] wrote: Matthias Bauer wrote: I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. +1 So far I haven't heard any definitive answer to the performance question. If there isn't any performance penalty then we don't need the ability to turn off pattern matching. I'm starting to think this enhancement should wait for 1.2.1 instead of trying to squeeze it in for 1.2.0. David --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
The one thing that the ticket doesn't say specifically is whether you are already using the patch in a working application. If so, and it's working well for you in practice, then I'd say commit it. But, if its experimental, then I'd say let's roll a 1.2.x GA first before playing with something this deep in the API. The cutting point being whether you, as a Committer, have a high-degree of confidence in the code. We should probably mark the feature experimental in either case, just to see what shakes out when it's presented to the Community. -Ted. Don Brown wrote: I'd like to put the wildcard-matched action code from Bug #21813 (http://issues.apache.org/bugzilla/show_bug.cgi?id=21813) into Struts. When I mentioned it last, the only concern I heard raised was from Craig regarding performance penalties. As I noted in the bug description, the path isn't checked against compiled wildcards until an exact match cannot be found. Even then, it is only checked against action mappings that actually contain at least one wildcard. Let me know if anyone has any reason I shouldn't do this or concerns I can hopefully alleviate. Thanks. Don - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
I apologize if I wasn't clear; there is absolutely no performance penalty for any existing or future Struts applications that do not use wildcards. Upon initialization of the RequestProcessor, it runs through each action mapping to see if any of them use wildcards. Only if a wildcard is found in the path attribute, the path value is compiled and added to a list of expressions to test. Therefore, if wildcards aren't used at all, this feature is completely ignored. When processMapping() is called, the path is tested against compiled wildcards only if the following requirements are NOT met: 1) There is no direct match for the path (usual Struts behavior) 2) There is at least one action mapping that uses wildcards Therefore, even if your entire application relies on the default action mapping, if you are not using wildcards, your application will suffer no penalty. As for putting it in post-1.2.0, that is fine. I've been using the code for over a month in my day job's application and it has been in stxx (http://stxx.sf.net) for as long. Furthermore, the core of it comes from Cocoon and forms the basis for how pipelines are matched in their sitemap. In my application, it cut the number of action mappings by 66% making Struts tons more manageable. But again, its completely optional and doesn't affect anyone who doesn't use wildcards. Don On Tue, 12 Aug 2003, David Graham wrote: --- Robert Leland [EMAIL PROTECTED] wrote: Matthias Bauer wrote: I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. +1 So far I haven't heard any definitive answer to the performance question. If there isn't any performance penalty then we don't need the ability to turn off pattern matching. I'm starting to think this enhancement should wait for 1.2.1 instead of trying to squeeze it in for 1.2.0. David --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
I haven't actually look at the code yet, but as I understand it, wildcards are not even considered unless no other match is found. In which case you would be getting an error page anyway. If that's the way it actually works (and I believe this was the original proposal), I'm ok with it -- the only potential performance impact for existing users would be those who rely on the default action capability to handle lots of requests, and that seems pretty unlikely. Well, it indeed looks pretty unlikely at first glance. Still, we are doing exactly this... We have built a Content Managment System (it's called XIST4C) that is based on Struts. Each normal content page (i. e. each page that is not part of an application integrated in the system) is served by a single action called DisplayAction, which is the default action. The different content pages are distinguished by ids. In order to be as search engine friendly as possible, we are encoding these ids in the url instead of appending them as query parameters. Thus, a typical url looks like this: http://www.medi.de/llcms/web/displayAction_id_1586_.htm I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Wildcard-matched actions (again)
Doesn't the last email from Don imply there is no penalty (if the person isn't using wildcards)? -- extract from Don's last email You still wouldn't see any performance hit as since you aren't using any action mappings with wildcards, there would be no pattern matching. It can only match a URI against a compiled pattern if one or more action mappings use wildcards. If there are no compiled patterns, the method will simply exit and your default action will be matched. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 3:39 PM To: Struts Developers List Subject: Re: Wildcard-matched actions (again) --- Robert Leland [EMAIL PROTECTED] wrote: Matthias Bauer wrote: I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. +1 So far I haven't heard any definitive answer to the performance question. If there isn't any performance penalty then we don't need the ability to turn off pattern matching. I'm starting to think this enhancement should wait for 1.2.1 instead of trying to squeeze it in for 1.2.0. David --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
You still wouldn't see any performance hit as since you aren't using any action mappings with wildcards, there would be no pattern matching. It can only match a URI against a compiled pattern if one or more action mappings use wildcards. If there are no compiled patterns, the method will simply exit and your default action will be matched. Now, this also would be a good example of an app that could use wildcards. You could match the id's and stick them in the parameter of the action mapping to retrieve in the action. I currently use wildcards in my Struts app that exposes REST-style web services where everything is encoded in the URI. The wildcard matching code is very fast as the patterns are pre-compiled and since the code comes stright from Cocoon who has been using it for quite a while, it has stood the test of time. Don Well, it indeed looks pretty unlikely at first glance. Still, we are doing exactly this... We have built a Content Managment System (it's called XIST4C) that is based on Struts. Each normal content page (i. e. each page that is not part of an application integrated in the system) is served by a single action called DisplayAction, which is the default action. The different content pages are distinguished by ids. In order to be as search engine friendly as possible, we are encoding these ids in the url instead of appending them as query parameters. Thus, a typical url looks like this: http://www.medi.de/llcms/web/displayAction_id_1586_.htm I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wildcard-matched actions (again)
I'd like to put the wildcard-matched action code from Bug #21813 (http://issues.apache.org/bugzilla/show_bug.cgi?id=21813) into Struts. When I mentioned it last, the only concern I heard raised was from Craig regarding performance penalties. As I noted in the bug description, the path isn't checked against compiled wildcards until an exact match cannot be found. Even then, it is only checked against action mappings that actually contain at least one wildcard. Let me know if anyone has any reason I shouldn't do this or concerns I can hopefully alleviate. Thanks. Don - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
--- Robert Leland [EMAIL PROTECTED] wrote: Matthias Bauer wrote: I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. +1 So far I haven't heard any definitive answer to the performance question. If there isn't any performance penalty then we don't need the ability to turn off pattern matching. I'm starting to think this enhancement should wait for 1.2.1 instead of trying to squeeze it in for 1.2.0. David --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
Matthias Bauer wrote: I would like to be able to turn off this pattern matching feature, as performance is a very critical issue for a CMS. +1 --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
Don Brown wrote: Heh, thankfully no. :) In fact, that's one of the reasons I'd like to incorporate this into Struts itself to remove that alternate processor requirement. The patch adds a couple of lines to RequestProcessor.processMapping() to, in the case of no direct mapping found, try to match any wildcards. All of the logic of wildcard mapping is stored in a helper class to keep RequestProcessor as clean as possible. Don How about an option to turn it off ? Having something infinitely configurable is good right ;-) ! But seriously, if there will be noticeable overhead the ability should be able to be turned off. In fact once struts configuration is frozen then it should be able to detect whether it needs to search for wild card matches or not. -Rob -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wildcard-matched actions (again)
--- Don Brown [EMAIL PROTECTED] wrote: I'd like to put the wildcard-matched action code from Bug #21813 (http://issues.apache.org/bugzilla/show_bug.cgi?id=21813) into Struts. When I mentioned it last, the only concern I heard raised was from Craig regarding performance penalties. As I noted in the bug description, the path isn't checked against compiled wildcards until an exact match cannot be found. Even then, it is only checked against action mappings that actually contain at least one wildcard. Let me know if anyone has any reason I shouldn't do this or concerns I can hopefully alleviate. Thanks. Looks pretty neat. On your site you have a custom WildcardRequestProcessor that performs this behavior. Are you planning on incorporating it directly into RequestProcessor now? I don't think we should exasperate the poor RequestProcessor situation any further by adding more of them. David Don - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]