Re: Implementing a Controller Servlet: forward to another servlet without cluttering up web.xml



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
.



Relevant Pages

  • Basic Struts work flow question
    ... I am developing a small app to learn Struts. ... Student and course are 1:N relationship. ... Or shall I create an Action class for each individual ... Each JSP page use corresponding ActionForm bean. ...
    (comp.lang.java.programmer)
  • Re: J2EE - EJB and Struts
    ... >visualizing how all of the components interact - example the ... default Struts servlet. ... The Action Class is your model. ... It is here that you make calls to your EJB. ...
    (comp.lang.java.programmer)
  • Re: getServletContext() Problem
    ... JSP, Action class, and a ... > JSP: ... Forgive my unfamiliarity with the details of Struts, ... the servlet instance that instantiated the Action, ...
    (comp.lang.java.programmer)
  • Struts Action Class Not getting called
    ... Running on Xp with WSAD5.0.1 an action class is ... What is worse, the error is so low level, clearly ... Is Struts confusing WSAD ... source code and compile struts? ...
    (comp.lang.java)
  • Re: MVC/Servlet & URL links question
    ... If you have not looked at Struts - do consider it. ... mappings externally in a configuration file, where in your servlet can ... Struts framework will take care of forwarding/redirecting the requests. ...
    (comp.lang.java.programmer)