Apache Tomcat and Servlets configuration...

Hi there fellow Javites,
does anybody know how to configure the apache tomcat server xml file to enable you to use the "old servlet url technique"? I hear that its been disabled by default in newer versions Tomcat.
You know where you would previously type in: http://localhost:8080/servlet/folder1.servlets.TheServlet
,but now you have to tell your web.xml file where your servlet is so you now have to type in:
http://localhost:8080/TheServlet
That is, unless you enable the server config file to allow you to do both.
I hate to ask such questions but I really hate the Apache Tomcat documentation.
Thanks.

Hi there,
well I was kinda hoping they'd be a shortcut to having to map the servlet in the web.xml file. In the older versions of the Apache tomcat you used to just be able to type in the url and the Servlet would be found.
Does anybody know how to enable the later versions of Apache Tomcat via the config file to use the old style of Servlet mapping?
I guess a more important question I should be asking also is, is this older style of mapping servlets now considered bad practice and is why it is no longer enabled by default in more recent Apache Tomcat versions???
Thank you, this community rocks! Keep up the Javite work guys, they'll never take us alive. NO LOL. :D

Similar Messages

  • From where can we dowload Apache tomcat and how to install

    From where can we dowload Apache tomcat and how to install

    http://jakarta.apache.org/tomcat/tomcat-5.5-doc/index.html

  • GPL Licence, Apache Tomcat and J2EE5

    Hello !
    I'd like to know if it is possible for a company to sell a server with apache tomcat and J2EE 5 ?
    Does this company have to pay fees to Sun ?

    Hi,
    I have same problem with B1 9.1, Version for Hana, but I cannot apply the workaround of San Xu on linux server.
    I try a clean installation of 9.1 servertools on linux server, but on windows server, when I run the Upgrade.exe for the databases, the error appears: "Could not connect to licence server; enter valid password".
    I've the italian localization.
    Can someone help me?
    Thanks & Regards
    Valerio

  • Apache Tomcat and Authentication Control

    Hi,
    IIS has �Basic Authentication� to check for username and password.
    Does anyone knows a way to set up and configures Apache Tomcat 4.1.XX to authenticate the user? I have the default web site: http://localhost:8080/test/servlet/com.test.HomeServlet and I want authenticate the user before they get to this page.
    Note: http://localhost:8080/admin/login.jsp has the login page for the admin. Can I reuse this login page and using the same users database for my default web site?
    Please help, Thanks!
    -John

    Hi,
    After starting your server, hit the following URL in a browser window.
    http://localhost:8080/tomcat-docs/realm-howto.html
    This documentation will give you some idea how to authenticate users in Tomcat.
    Thanks and regards,
    Pazhanikanthan. P

  • Oracle-Java-Apache-Tomcat-JK connector configuration help...

    Windows 7 Ultimate 64-bit
    Oracle 12c
    Java 8
    Apache HTTP server 2.4.10
    Tomcat 8.0.15
    JK Connector 1.2.40
    Here are the main configuration files httpd.conf, mod_jk.conf, server.xml, and workers.properties.
    When I browse to a .jsp file, it appears to be read as html, thus not reading <jsp:include> statements as such.
    Please suggest minimum configuration.
    httpd.conf
    Define SRVROOT "/apache"
    ServerRoot "${SRVROOT}"
    Listen 80
    LoadModule actions_module modules/mod_actions.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule allowmethods_module modules/mod_allowmethods.so
    LoadModule asis_module modules/mod_asis.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule authn_core_module modules/mod_authn_core.so
    LoadModule authn_file_module modules/mod_authn_file.so
    LoadModule authz_core_module modules/mod_authz_core.so
    LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_host_module modules/mod_authz_host.so
    LoadModule authz_user_module modules/mod_authz_user.so
    LoadModule autoindex_module modules/mod_autoindex.so
    LoadModule cgi_module modules/mod_cgi.so
    LoadModule dir_module modules/mod_dir.so
    LoadModule env_module modules/mod_env.so
    LoadModule include_module modules/mod_include.so
    LoadModule isapi_module modules/mod_isapi.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule negotiation_module modules/mod_negotiation.so
    LoadModule setenvif_module modules/mod_setenvif.so
    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    LoadModule ssl_module modules/mod_ssl.so
    ServerName localhost:80
    #experimental section starts here
    #experimental section ends here
    # Virtual hosts
    NameVirtualHost *
    Include conf/mod_jk.conf
    mod_jk.conf
    LoadModule jk_module modules/mod_jk.so
    JkWorkersFile "c:/tomcat/conf/jk/workers.properties"
    JkMount /servlet/*  ajp13
    JkMount /*.jsp  ajp13
    <VirtualHost *>
    ServerName om1001001.omnisocial.com
    DocumentRoot "c:/data/fxality/java001"
    </VirtualHost>
    <VirtualHost *>
    ServerName om1001002.omnisocial.com
    DocumentRoot "c:/data/fxality/java002"
    </VirtualHost>
    <VirtualHost *>
    ServerName om1001003.omnisocial.com
    DocumentRoot "c:/data/fxality/java003"
    </VirtualHost>
    server.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Server port="8005" shutdown="SHUTDOWN">
    <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    </GlobalNamingResources>
    <Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/></Realm>
    <Host name="localhost"  appBase="webapps"/>
    <Host name="om1001001.omnisocial.com" appBase="c:/data/fxality/java001">
    <Context path="" docBase=""></Context>
    </Host>
    <Host name="om1001002.omnisocial.com" appBase="c:/data/fxality/java002">
    <Context path="" docBase=""></Context>
    </Host>
    <Host name="om1001003.omnisocial.com" appBase="c:/data/fxality/java003">
    <Context path="" docBase=""></Context>
    </Host>
    </Engine>
    </Service>
    </Server>
    workers.properties
    # BEGIN workers.properties
    # Definition for Ajp13 worker
    worker.list=ajp13
    worker.ajp13.type=ajp13
    worker.ajp13.host=localhost
    worker.ajp13.port=8009
    # END workers.properties

    I haven't studied your problem in detail and don't actually use Tomcat 6, but in earlier versions of Tomcat the handling of JNDI leaves a lot to be desired. If you search this forum for posts about Tomcat and JNDI, you will find some useful information.
    One thing I found was that you really need to use the context.xml file in your Meta-inf directory, putting the datasource anywhere else gets into one kind of trouble or another. I tried using server.xml, a context file for the application and the web-inf file.

  • Error with JSP, Apache Tomcat and SQL

    Hi,
    I was trying to do some user suthentication script.
    This was my code..
    <html>
    <body>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.util.*" %>
    <%
    String Username1 = "";
    String Password1 = "";
    String Username2 = "";
    String Password2 = "";
    String qry = "";
    Username2 = request.getParameter("uname");
    Password2 = request.getParameter("pass");
    qry = "select * from tbl_Users where Username="+Username2;
    ResultSet Rs;
    PreparedStatement pstmt=null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:BankDSN");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select * from tbl_Users");
    while (rs.next())
    Username1 = rs.getString("Username");
         Password1 = rs.getString("Password");     
         if (Password1 == Password2)
         response.sendRedirect("home.jsp");
         else
         response.sendRedirect("sorry.jsp");
    rs.close();
    stmt.close();
    con.close();
    %>
    </table>
    </body>
    </html>
    When I tried to invoke the JSP page, I got the following error
    Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    java.lang.IllegalStateException
         at org.apache.catalina.connector.HttpResponseFacade.sendRedirect(HttpResponseFacade.java:173)
         at org.apache.jsp.validate$jsp._jspService(validate$jsp.java:99)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:595)
    Any help would be appreciated.....
    Regards,
    Ramprasad

    Dear vraptor,
    I had seen ur jsp page , can i tell u one thing , never write a connection in the jsp page, why becoz the code can be seen.
    ok here the problem is ur getting the username and password and putting an if condition inside the while loop so this throws an error.
    anyway ur getting the values like
    while (rs.next())
    Username1 = rs.getString("Username");
    Password1 = rs.getString("Password");
    now the username and password are already retrived from server side, just do the check now outside the loop.
    if (Password1 == Password2)
    response.sendRedirect("home.jsp");
    else
    response.sendRedirect("sorry.jsp");
    one more thing is check whether the page forwarding to correct page like response.sendRedirect("home.jsp");
    see for the "/<directory Name>"/home.jsp if u keep all the jsp at one directory.
    i mean this response.sendRedirect("/jspdirectory/home.jsp");
    try this
    regards
    haribabu

  • Apache Tomcat and eclipse for EP

    Hi,
    I have got anew book on SAP Enterprise protal by SAP Press.
    There is also a CD which contains Portal development kit, eclipse 2.1, apache tomcat 3.3.1 and portal development kit plug-in for eclipse.
    I don't have any SAP Access as if now.
    Is it possible to learn SAP EP programming based on the softwares I have got on these CD and the book.
    Tushar

    Tushur,  yes you can use that software to learn how to code JSPDynPage applications for the portal.   This is how I started learning portal technology.  I have since moved on to webdynpro.   You might consider, as Srinivas suggested,  download the Sneak Preview of WAS 6.40 java.  This will give you a complete development envirnment,  the NWDS,  the portal,  and the WAS to run it on.  Next thing you now, you'll be writing webdynpro apps like the best of em.
    Regards,
    Rich Heilman

  • Tomcat and servlet

    hi to all... i've configured my tomcat 6.0 for the deployment of servlet but i always get a 404 error, servlet not available...
    environment variables:
    classpath has been pointed to servlet-api.jar ans jsp-api.jar
    java_home set to point to jdk folder
    configuration of tomcat:
    conf/web.xml: uncomment servlet/* and its corresponding servlet mapping
    conf/context.xml: set reloadable="true"
    still when i do all of this nothing works! even my html pages! error page not found...
    whats the problem?
    plz help with the configuration of tomcat
    heartful thx

    I am having the same problem. I tried exactly like an example of a book.
    Then i read this thread and I tried to load the examples that come with tomcat.
    http://localhost:8080/servlet-examples/servlet/HelloWorldExample
    And it�s not working. It works only .html files, for example:
    http://localhost:8080 -> opens the tomcat homepage
    http://localhost:8080/jspbook/index.html ->opens my example
    my project looks like this(inside the webapps) /jspbook/ WEB-INF ; build.xml ; index.html
    /jspbook/WEB-INF/ web.xml ; classes
    /jspbook/WEB-INF/classes/com/jspbook/HelloWorld.java
    My web.xml got:
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>com.jspbook.HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/hello</url-pattern>
    </servlet-mapping>
    Then I try to acess it
    http://localhost:8080/jspbook/hello
    and I get 404. the resource is no available
    Who can help me?

  • Apache, Tomcat  and mod_jk2

    Hi, I' m sorry I posted this topic in other forum( I made a mistake).
    I 'm trying to create a cluster server using Apache and two Tomcat's instance. My problem is when I have to use the JK2 connector (reference http://tomcat.apache.org/tomcat-4.1-doc/config/jk.html) because I need to compile some files, but I new in solaris and I don't know how to do it.
    I downloaded the file from this site http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2/
    I'm using Apache 2.0.55, Tomcat 5.028 and Solaris 9
    I need to create a mod_jk2.so file
    Does someone help me?
    Regards

    I've only ever done this in windows. This page should take you through it ok though:
    http://www.cymulacrum.net/tomcat/tomcat_mod_jk2.html

  • Apache tomcat and mod_jk2 with awstats

    Hi all,
    Here's my situation.
    I've 2 servers, web server (apache with perl)
    and app. server (tomcat, java)
    link with mod_jk2.
    I would like to install awstats for get web stat. data.
    I installed it in web server. can run the perl and get some result. I can generate awstats static pages result. but I would like to allow user to view on web.
    such as http://www.abc.com/awstats/awstats.pl?config=xxx.
    because mod_jk is using, all request / response will send to app. server. how to exclude the awstats directory? which means user cannot view the awstats report on web.
    pls help
    thanks
    Regards,
    Kin

    Ended up downloading and installing the mod_jk instead of the mod_jk2 that came with RedHat Application Server.

  • How to install apache tomcat in nebeans

    hello everyone,
    i am not able to configure apache tomcat in my netbeans.
    i am little bit confuse between apache tomcat and glassfish servers. can any one tell where we glassfish and where we use apache tomcat?

    Tomcat is a 'servlet engine'; put as simple as I can make it, it is a Java webserver. You can create web applications based on servlets & JSPs and run them on Tomcat.
    Glassfish is an Java Enterprise (JEE) server and provides an implementation for the full Java Enterprise Edition specification. This also includes servlets & JSPs, but on top of that you get a whole batch of additional services.
    I would start with Tomcat if I were you. You don't need to configure anything, if you download the proper Netbeans bundle it comes with Tomcat 7 already setup. If that is not the case, you either picked the wrong bundle or you made wrong decisions during installation.
    edit:
    Question for you. Do you know anything about Java at all (since you are posting this in new to java)? If not then you are waaaaaaaay out of your league trying to get into web programming, it is complicated and confusing enough if you know Java, it is near impossible to understand if you don't even know the basics of the basics yet.
    Edited by: gimbal2 on Aug 5, 2011 3:57 AM

  • JSP & Apache Tomcat  &hsqldb

    HI every one,please be patient while reading this message.
    I installed apache tomcat and created a database by hsqldb.i want to work with this database from my JSP files.i read the documentation of hsqldb and they say that the best mode or the official one is to run the servlet server(as you know there are five modes of server).and they say that the servlet engine(Apache in this case) is responsible for lanching this servlet server.How can i run it and solve this problem.
    thanks very very much.

    thnx a lot for replying but what i want to know is how to
    1- create database with hsqldb
    2-add,delete ,insert ... to the database from jsp with apache running.
    Note:will this steps be the same if i put the files on my site and also the database.
    i mean ,will the same configurations be ok/
    thnx again and waiting for your reply.

  • Tomcat ?& servlet

    Hi,
    I am new to tomcat and servlet and dont know how to execute servlets in tomcat3.3. I have saved my servlet files in webapps\examples\web-inf\classes but when I try to run the servlet in browser I get the error messgae page not found. Please help
    thanks

    have u configured your servlet in web.xml in ..\webapps\examples\web-inf ?? you need to add your servlet name and servlet class at least there? see the web.xml file provided in ..examples\web-inf
    regards,
    Padmanava

  • JBOSS or Apache Tomcat

    which server is better? jboss or apache tomcat? can anyone pls give their advantages and disadvantages. Thanks

    Just do the usual as for every other comparisons:
    1) List all specs/features of each (you can find them at their homepages).
    2) Put the lists next to each other and just outweight the one or other.
    It might be good to know that JBoss AS under the hood actually uses Apache Tomcat as servlet container and adds some more sausage over it. Just determine if you actually need/like the sausage of JBoss on Apache Tomcat.

  • Apex Listener/Apache Tomact and filenames with spaces

    I've installed the Apex Listener with Apache Tomcat, and all seems to work fine. Except when I try to do a CSV file data upload via the utilities screen in apex. If the filename/directory path contains spaces, then Apex reports "File Must Be Specified" error - yet if I do this same operation via EPG instead of Tomcat, it works. Are there any restrictions in Tomcat to using spaces??

    Look at this thread. Re: File upload problem
    regards.

Maybe you are looking for

  • 2 external monitors for imac?

    Is it possible to connect two external monitors to the new 2013 IMAC?  If so, how?

  • Data Tables in C++

    I am facing a desperate situation where i need to keep data of all the records of a table. e.g ( select * from CUSTOMERS ) is there a Data Table kind of a structure either developed by a third party or a OCCI structure that you'll guys know of. this

  • Queues in READY status for no apparent reason

    Dear All, This question has been posted many times but never saw a conclusive answer on this forum. To repeat, I see queues being built in READY status in APO inbound for no apparent reason. All settings of scheduler being fine (SMQS - Type R), there

  • SAP GUI and Java reqs

    I am putting together some documentation for the Java requirements for SAP applications on RHEL5 for customers. Can someone sanity check this for me please? The SAP GUI requires at least Java 1.5 to run, so a customer should install the Java 1.6.0_16

  • Music on different computers

    I have two different computers with iTunes on them. Currently I cannot access the internet with my computer that my iPod is installed on. Is it possible to download music on my other computer and put it on my iPod without burning it to a CD and impor