I must confess that I'm still a little confused. You are trying to abstract the command-mapping out of both maverick.xml and your Controller code?
I'm not sure how you would do that short of parsing the web.xml yourself; I don't think the servlet API offers any way of programmatically determining how servlets are mapped. Also, it's possible to have multiple mappings to the same servlet, so I'm not quite sure what behavior you would want there. My recommendation would be to just use a mapping that you like (be it *.m, *.do, or whatever) and just stick with it dogmatically. Pretty much all MVC frameworks let you do this kind of mapping, so it doesn't really matter what you use. If you can build a patch that simply and elegantly does what you're looking for, make a proposal and we'll vote on it. My gut feeling is that this doesn't seem to offer a lot of benefit for the added complexity, but I'm not sure I really understand what you're trying to do. Jeff Schnitzer [EMAIL PROTECTED] > -----Original Message----- > From: Roy Truelove [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 03, 2002 3:33 PM > To: [EMAIL PROTECTED] > Subject: Re: [Mav-user] specifying redirects in the maverick.xml file > > I can dynamically generate redirects with no trouble using the > RedirectView, > but (and I'm probably just being a stickler here) I'd have to hardcode the > URL in my Command classes, before I set it in the model. Technically, I'm > not supposed to know how these URL's are generated, since that's taken > care > of with the web.xml file in the URL-Pattern. I'm talking about something > that does kind of the opposite of Dispatcher's extractCommandName(); it > would take a command and push out a URL to be redirected to. This is all > probably just my being design-anal and might not *really* matter... > > Thanks, > Roy > > > ----- Original Message ----- > From: "Schnitzer, Jeff" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 03, 2002 2:38 PM > Subject: [Mav-user] specifying redirects in the maverick.xml file > > > > [grrr, SF is bouncing mail from my normal account] > > > > I'm a little confused by what you want to do, but my suspicion is that > > maverick already supports it. > > > > All <controller>, <view>, and <transform> elements can have <param> > > child elements. These params are available in code from the > > {Controller|View|Transform}Context object. > > > > Redirect views support a number of ways of dynamically generating the > > target. Take a look at the javadocs for > > org.infohazard.maverick.view.RedirectViewFactory. If you set a String > > as the model, it becomes the base URL (the path attribute, if it exists, > > is ignored). Params (set either from the config file or from the > > Controller with ControllerContext.setParam()) become query parameters. > > > > Since you're probably generating the redirect path in your controller, > > perhaps what you want is a <param> node on the <controller> element? > > > > Jeff Schnitzer > > [EMAIL PROTECTED] > > > > > -----Original Message----- > > > From: Roy Truelove [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, July 03, 2002 10:23 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [Mav-user] specifying redirects in the maverick.xml file > > > > > > Creating a custom view type is a good idea, but only if other people > > need > > > this kind of functionality. I'm writing a workflow implementation > > that > > > works with Maverick and will be using redirects very often (for > > internal > > > "bookmarking" capabilities, etc.) My redirects will mostly be > > dynamically > > > generated, and not specified in the XML config, so I'd need to know > > how to > > > generate a full URL from just a command name. Having a view that does > > > this > > > for me would be useful. > > > > > > I proposed it as a patch because I felt for design reasons, it's best > > to > > > keep URL's out of the config file and keep it all command-only. > > > > > > -Roy > > > > > > ----- Original Message ----- > > > From: "jim moore" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Wednesday, July 03, 2002 11:41 AM > > > Subject: Re: [Mav-user] specifying redirects in the maverick.xml file > > > > > > > > > > Personally I think this may just confuse things. Right now the > > behavior > > > of > > > a > > > > redirect is pretty straightforward--its sending a physical redirect > > to > > > the > > > > browser, telling it to ask for the new url you specify (this could > > be a > > > > .html, .jsp, .m, .fo, .pdf, /servlet/foo, whatever). I'm not sure I > > see > > > what > > > > we would achieve be redirecting to a logical view. Are you trying to > > > avoid > > > > the roundtrip to the browser and do something closer to a > > > > RequestDispather.include() or RequestDispather.forward()? > > > > > > > > Either way, I don't think I'm in favor of compromising the > > > > straightforwardness of the standard redirect view as right now it > > does > > > > exactly what one would expect. That is not to say however that there > > is > > > no > > > > room for this functionality if you need it. Rather than modifying > > > > RedirectView, why not take a stab at creating your own > > > LogicalRedirectView, > > > > which would take a maverick command as the path attribute, like so: > > > > > > > > <view name="success" type="logicalRedirect" path="welcome"/> > > > > > > > > Maverick is remarkably pluggable, so plugging in new view types is > > > pretty > > > > straigtforward. Check out opt-domify as an example of plugging in a > > > custom > > > > view type. > > > > > > > > --jim > > > > > > > > ----- Original Message ----- > > > > From: "Roy Truelove" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Wednesday, July 03, 2002 11:24 AM > > > > Subject: [Mav-user] specifying redirects in the maverick.xml file > > > > > > > > > > > > > Hello all, > > > > > > > > > > I have a proposal to deal with redirects in the maverick.xml > > file. > > > > > Right now redirect paths to commands have to be "hardcoded", > > insofar > > > as > > > > you > > > > > have to specify the redirect not as a logical command name but as > > a > > > > physical > > > > > URL, i.e.: > > > > > > > > > > <view name="success" type="redirect" path="welcome.m"/> > > > > > > > > > > I'd like to write a patch that would support this type of > > > functionality > > > : > > > > > > > > > > <view name="success" type="redirect" path="welcome"> > > > > > <param name="isCommand" value="true"/> > > > > > </view> > > > > > > > > > > As well as a standard redirect to a non-command: > > > > > > > > > > <view name="success" type="redirect" path="somePage.html"/> > > > > > > > > > > This way all references to commands are logical references rather > > than > > > > > physical. > > > > > > > > > > If this sounds like a good idea, please let me know, and I'll get > > > > cracking. > > > > > > > > > > Thanks, > > > > > Roy > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This sf.net email is sponsored by:ThinkGeek > > > > > No, I will not fix your computer. > > > > > http://thinkgeek.com/sf > > > > > _______________________________________________ > > > > > Mav-user mailing list > > > > > [EMAIL PROTECTED] > > > > > https://lists.sourceforge.net/lists/listinfo/mav-user > > > > > Archives are available at http://www.mail-archive.com/ > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > No, I will not fix your computer. > > > > http://thinkgeek.com/sf > > > > _______________________________________________ > > > > Mav-user mailing list > > > > [EMAIL PROTECTED] > > > > https://lists.sourceforge.net/lists/listinfo/mav-user > > > > Archives are available at http://www.mail-archive.com/ > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > No, I will not fix your computer. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > Mav-user mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/mav-user > > > Archives are available at http://www.mail-archive.com/ > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > No, I will not fix your computer. > > http://thinkgeek.com/sf > > _______________________________________________ > > Mav-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/mav-user > > Archives are available at http://www.mail-archive.com/ > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > No, I will not fix your computer. > http://thinkgeek.com/sf > _______________________________________________ > Mav-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/mav-user > Archives are available at http://www.mail-archive.com/ ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek No, I will not fix your computer. http://thinkgeek.com/sf _______________________________________________ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user Archives are available at http://www.mail-archive.com/
