Re: Implementing a Controller Servlet: forward to another servlet without cluttering up web.xml
- From: Bryce <spamtrap@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 10:23:12 -0500
On Sat, 29 Oct 2005 12:31:34 +0200, Alex Meier
<superdoehli_nospam@xxxxxx> wrote:
>> Or, you can just define the "action" class from an interface, use the
>> action=<SomeClass> parameter, and instantiate the "SomeClass" class,
>> and delegate to it... Not perfect, but that's what we do (or use
>> something like Struts which has that sort of thing built in, but then
>> you'll have to "clutter" up the struts config file...)
>
>Do you know...is this how Struts does it?
Yes, struts uses a configuration file to determine what Action class
to invoke. Except Struts (by default) uses an extension on the URL to
determine the action, and looks this action up in the Struts Config
file to determine the class to delegate to.
i.e.,
http://www.somedomain.com/myapp/myaction.do
if it ends in .do, then it looks for myaction in the config file.
--
now with more cowbell
.
- References:
- Prev by Date: Re: help please
- Next by Date: How to compile a java program w/ another java programs which are w/o a main method
- Previous by thread: Re: Implementing a Controller Servlet: forward to another servlet without cluttering up web.xml
- Next by thread: Strings
- Index(es):
Relevant Pages
|
|