Sanjay Sharma wrote:

> Hi,
> In the logic to map Controller Servlet to a filename extension, where should
> the Hashtable reference be stored. I'm confused, it should be as servlet
> class variable (static) or should be stored in the ServletContext.
>
> I have another question, I'm not very sure about this too.
> The initialization values for the hashtable should come from the web.xml
> file, in the form of init-param element, or there is another better way of
> doing it. My concern is this list in web.xml can grow into a very long list.
>

Instead of building all of the controller infrastructure yourself, you might want
to try using a framework that has done all this kind of stuff for you.  One example
is the Struts framework <http://jakarta.apache.org/struts>, which includes all of
this kind of thing (it loads action mappings from a separate configuration file),
plus a whole lot more -- including a nice custom tag library for building form
based web applications.

Even if you're determined to roll your own :-), looking at how others have solved
the problem is useful, and Struts is open source.

>
> Thanks in advance.
> Regards,
> Sanjay
>

Craig McClanahan

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to