tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego <>
Subject embed Servlets validation
Date Mon, 03 Sep 2012 19:39:25 GMT
Sorry, only subscribers may post. If you are a subscriber, check to be sure you are sending
from your subscribed address. (#5.7.2)

--- Below this line is a copy of the message.
User-Agent: Mozilla/6.4 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0.0
MIME-Version: 1.0
Subject: Servlets validation
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 03 Sep 2012 19:27:11.0403 (UTC) FILETIME=[1D920FB0:01CD8A0A]

I there. my first post around

Look. i've been working out an embedded Tomcat 7.0.22~ and found out some
setting up servlets from the interface.

My configuration didn't find web.xml so far, so i used the servlet
context inside the embedded structure not so problematic but insted
the problem goes for working out several platforms would be much better
keeping up the original web.xml op to dates

i went as next

  class {
      public static void main(String[] args) throws Exception {

          String docBase = "src/main/webapp";
          String baseDir = "src/main/webapp";
          Tomcat tomcat = new Tomcat();

          StandardContext e = (StandardContext) new StandardContext();
### ???        e.setDefaultWebXml("web.xml");
          tomcat.getHost().setAppBase(new File(docBase).getAbsolutePath());

          tomcat.addWebapp("/", new File(docBase).getAbsolutePath());
          tomcat.addWebapp("/admin", new File(docBase +

            // Add AprLifecycleListener
            StandardServer server = (StandardServer)tomcat.getServer();
            AprLifecycleListener listener = new AprLifecycleListener();

            Context ctxt = tomcat.addContext("/s", new
            Tomcat.addServlet(ctxt, "MyServlet", new servlet.HelloServlet());
          ctxt.addServletMapping("/hello", "MyServlet");

          tomcat.setBaseDir(new File(docBase).getAbsolutePath());

            // 4866562 Nilda


i know that's a wrapup from tomcat6 to tomcat7 indeed i will coexist
both if possible to extend failover
among different hosting platforms aka intranet, heroku, etc.

main problem is i need a more secular form of setting up servlets even
for web.xml or embedded or any other
i wonder if there's any help so i could move on further on threading and

either way i will solve it, i just wondering how active the list
actually was,
i could join the master dev list if possible but i'm not sure of the
volume handling options
so i used unique post to test my chances, thank you.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message