Simple web.xml question

Hi all,
Do I have to restart Tomcat whenever I make changes to any web.xml file(either global or individual web apps)?
Thanks for your help.

No.
You have UpdateFiles and Deploy options in the Deploy Tool Version 8, for example. This is an elegant solution.
I am sure that there is also a command from the command prompt. But I have already forgoten.

Similar Messages

  • How to create a simple web.xml for using servlets

    Hello i wanna configure the web.xml that i can use sevlets and beans, but how can i do that?
    This is de directorie i have installed my webapp
    C:\Tomcat 4.1\webapps\testapp
    C:\Tomcat 4.1\webapps\test\WEB-INF\classes (in this dir, I wanna put my beans and servlets, I got one servlet and the name is LogIn.class).
    And i wanna request my servlets with the url http://localhost:8080/testapp/servlet/LogIn
    How can i create a very basic web.xml with working beans, servlets and session? It is for testing-use only, so the security is not important for me at this moment.
    Tnx

    under your web-inf
    in your web.xml file you must map
    the servlets
    under the <web-app> tag type
    <servlet>
         <servlet-name>LogIn</servlet-name>
         <servlet-class>com.LogIn</servlet-class>
    </servlet>
    <servlet-mapping>
          <servlet-name>LogIn</servlet-name>
          <url-pattern>/LogIn</url-pattern>
    </servlet-mapping>ps: start using some IDE such as NetBeans or Ecclipse
    since they will take care of mapping all servlets and Beans
    and generate all the necessary files for your web-app

  • Web.xml question

    Hi Guys!
    I ran into a small problem.
    Im using the struts tiles framework to redesign a shopping cart .
    In the new framework,there are multiple websites(user interface tiles) that use the same servlets at the back end to process the requests. The control is passed back to the website that called the commonly shared servlets once the computations are done.The servlets, the various websites that use the servlets all reside on the same server and are a part of the same project.
    The whole project shares a common web.xml file.
    I was just wondering if each of the tiles can have thier own web.xml so that the servlet context can be loaded from them.
    The directory structure is like this
    Tiles Framework
    -Servlet Source
    -web.xml
    -tiles (folder)
    ---tile1(folder...contains the 1st website)
    ---tile2
    ---tile 3
    The reason being that in the older version of the shopping cart, the web.xml was used to load specfic contexts in the servlets.
    Is it possible that wach of the tiles has its own web.xml ?
    if so, does it require any configuration in the overall project.
    Thanks.

    If I understand the web.xml file correctly, there should only be one per project. But if it's just a matter of loading props for each of the tiles, can't you just have a different properties file for each tile?
    I can't imagine a situation where you'd be required to have multiple web.xml files within the same project. Can you explain why you can't just have several regular property files & read from them instead?

  • Web.xml question -- ejb-ref

    Can anyone explain the reasons for using the <ejb-ref> tag in the web.xml file?
    Currently, I have a context-param that matches a param-name to a param-value. My code looks up the param-value and, via JNDI, gets the EJB referenced.
    Does the <ejb-ref> tag provide an easier, more standard method for doing this or is it there just to show that particular EJB is referenced?
    Any information would be very helpful.

    Thanks, but this makes no sense to me. Why should a
    web app be different than any other app? Why make a
    special tag?
    Is this tag required? Is it possible to use an EJB
    without it or is this someone required?Your webapp can access the ejb without this tag at all but using its jndi name. This tag (<ejb-ref>) is just a standard way of accessing ejb's within the webapp.
    For eg. consider this WEB.XML,
    <ejb-ref>
    <description>Reference to DEPT bean</description>
    <ejb-ref-name>EJB-DeptRecord</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.test.DeptHome</home>
    <remote>com.test.DeptRemote</remote>
    </ejb-ref>
    You can lookup like this using the ejb-reference name.
    Context ctx = new InitialContext();
    Object obj = ctx.lookup("java:comp/env/EJB-DeptRecord"); <-------
    Since JNDI names usually have directory structure (eg. /test/ejb/..),
    this ejb-ref tag provides a convenient way to do the lookup without the jndi-name cluttering up your code.

  • Web.xml: wildchar /streams/* possible?

    i would like to get all requests for a directory to a specific servlet.
    i know that i could realize something like this:
    a) RewriteURL of apache
    b) with creating my own suffix like "*.mycontent"
    c) user something like "/streams/?filename"
    but i realy like to know if there is a way with simple web.xml way for it, since it doesn't work for me currently.

    this works for filters, why doesnt it should also work for servlets?
    like
         <servlet>
              <servlet-name>servletName</servlet-name>
              <servlet-class>some.Servlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>servletName</servlet-name>
              <url-pattern>/data/*</url-pattern>
         </servlet-mapping>     

  • Configuring web.xml for OpenSSO

    Hello!
    I am developing simple web application and want to use opensso in my web application.I have downloaded opensso,deployed and configured ,so i dont need how to configure web.xml ,what filters and jars i needed,i have the simple web.xml
    <web-app>
         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>admin</web-resource-name>
                   <url-pattern>/admin/*</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                   <role-name>admin</role-name>
              </auth-constraint>
         </security-constraint>
         <login-config>
              <auth-method>FORM</auth-method>
              <form-login-config>
                   <form-login-page>/login.jsp</form-login-page>
                   <form-error-page>/error.jsp</form-error-page>
              </form-login-config>
         </login-config>
         <security-role>
              <role-name>admin</role-name>
         </security-role>
    </web-app>so what filter should i add in web.xml so that when i access admins page <url-pattern>/admin/*</url-pattern>it should redirect to opensso s login page?

    Yes, I restarted the app server after making changes to web.xml file. No effects.

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • XML Question for web.xml file for LiteWebServer

    Hi,
    I have no clue of wut tags are required in the web.xml file.
    Currently the following code is in my web.xml file and i am trying to run servlets that are located under web-inf/*.class
    Pls tell me wuts wrong....
    Do i need those mime-mapping tags, session and welcome tags.......... ?
    Right now i just want those 2 servlets to work
    And wut is this encoding ="UTF-8" in the first line of the xml file. Wut does that do... ? ARe there any others
    Any help would b greatly appreciated
    Thanks
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app id="WebApp_1">
    <display-name>PDMPortal</display-name>
    <session-config id="SessionConfig_1">
    <session-timeout>60</session-timeout>
    </session-config>
    <mime-mapping id="MimeMapping_1">
    <extension>htc</extension>
    <mime-type>text/x-component</mime-type>
    </mime-mapping>
    <welcome-file-list id="WelcomeFileList_1">
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>HelloWorldExample</servlet-name>
    <servlet-class>HelloWorldExample</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>HelloWorld</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>HelloWorldExample</servlet-name>
    <url-pattern>HelloWorldExample</url-pattern>
    </servlet-mapping>
    </web-app>

    Try putting your servlets in the WEB-INF\classes directory.

  • Question on defining taglib in  web.xml

    I am using netbeans to develop a j2ee5 web application.
    I created a web application project using the wizard.
    When I defined a <taglib> in the web.xml, it detected an error.
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":distributable, "http://java.sun.com/xml/ns/javaee":context-param, "http://java.sun.com/xml/ns/javaee":filter, "http://java.sun.com/xml/ns/javaee":filter-mapping, "http://java.sun.com/xml/ns/javaee":listener, "http://java.sun.com/xml/ns/javaee":servlet, "http://java.sun.com/xml/ns/javaee":servlet-mapping, "http://java.sun.com/xml/ns/javaee":session-config, "http://java.sun.com/xml/ns/javaee":mime-mapping, "http://java.sun.com/xml/ns/javaee":welcome-file-list, "http://java.sun.com/xml/ns/javaee":error-page, "http://java.sun.com/xml/ns/javaee":jsp-config, "http://java.sun.com/xml/ns/javaee":security-constraint, "http://java.sun.com/xml/ns/javaee":login-config, "http://java.sun.com/xml/ns/javaee":security-role, "http://java.sun.com/xml/ns/javaee":env-entry, "http://java.sun.com/xml/ns/javaee":ejb-ref, "http://java.sun.com/xml/ns/javaee":ejb-local-ref, "http://java.sun.com/xml/ns/javaee":service-ref, "http://java.sun.com/xml/ns/javaee":resource-ref, "http://java.sun.com/xml/ns/javaee":resource-env-ref, "http://java.sun.com/xml/ns/javaee":message-destination-ref, "http://java.sun.com/xml/ns/javaee":persistence-context-ref, "http://java.sun.com/xml/ns/javaee":persistence-unit-ref, "http://java.sun.com/xml/ns/javaee":post-construct, "http://java.sun.com/xml/ns/javaee":pre-destroy, "http://java.sun.com/xml/ns/javaee":message-destination, "http://java.sun.com/xml/ns/javaee":locale-encoding-mapping-list}' is expected.
    Here is my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <welcome-file-list>
    <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>/mytag</taglib-uri>
    <taglib-location>/WEB-INF/mytag.tld</taglib-location>
    </taglib>
    </web-app>

    As of servlet 2.4 (jsp 2.0), you'll have to move the taglib declarations inside a <jsp_config> element.
    <jsp-config>
        <taglib> ..........your stuff
    </jsp-config>ram.

  • ANT Newbie question webxml="web.xml" ????

    I have following lines in my build.xml
    <war
            basedir="../"
            warfile="${distpath.project}/${project.distname}.war"
            webxml="web.xml">
            <exclude name="${distpath.project}/${project.distname}.war"/>
    </war>Can anybody tell me what is the meaning of webxml="web.xml" ???
    Also, if i am not wrong, does the last line mean that exclude the .war file while creating the war ???
    Thanks !!!

    Can anybody tell me what is the meaning of
    webxml="web.xml" ???This attribute is used to specify the XML file which contains the deployment descriptors for the web app. In short, if you specify "mydesc.xml" there, the XML will be copied to WEB-INF/web.xml
    Also, if i am not wrong, does the last line mean that
    exclude the .war file while creating the war ???This might be something like excluding the previously generated WAR files. Not sure really!

  • Question in spring-web.xml

    My application's name is Example.
    I want all webpages from /Example/*.htm to be directed to a servlet.
    And all pages from /Example/a/code to be directed to another servlet.
    "Code" does not end with .htm.
    I tried the below mapping in the web.xml. It does not work.
    <servlet-mapping>
         <servlet-name>Example</servlet-name>
         <url-pattern>/a/</url-pattern>
         </servlet-mapping>
         <servlet-mapping>
         <servlet-name>Example</servlet-name>
         <url-pattern>*.htm</url-pattern>
         </servlet-mapping>
    It works only if I add the following :
         <servlet-mapping>
         <servlet-name>Example</servlet-name>
         <url-pattern>/</url-pattern>
         </servlet-mapping>
    I dont want to add the above code. Is there another way. For some reason, spring throws an error with /a/*.

    Thanks for the reply.
    I did end up doing something like that in the end. I think I just couldn't get my mind into gear as usual on Monday.
    What's happening is taking a nice neat human readable URL and converting it to the horrible URL used by the system. The reason it's a filter is because someone had written a tiny filter would might only execute 20 lines of code and I think someone felt it was easier to just lump about 240 more lines to execute on each request, which, even if it isn't a huge strain on the system it's nasty and most of the code is unnecessary the vast majority of the time. I'm splitting it up the whole lot based on the various tasks.
    This particular functionality could be a servlet. I probably would have done it that if given the task from scratch but I think sometimes I put too much faith in the fact those with more experience should know better. I think I'll try it as a servlet and if someone has concerns about it then I'll ask them to explain to me why it can't be one.

  • Question about web.xml

    So in my web.xml file (for Tomcat 5.5) I used to map a servlet like this:
    <servlet-mapping>
    <servlet-name>
    ServletName
    </servlet-name>
    <url-pattern>
    /servlet/ServletName
    </url-pattern>
    </servlet-mapping>and it wouldn't work. Now when I map it like this:
    <servlet-mapping>
    <servlet-name>
    ServletName
    </servlet-name>
    <url-pattern>
    /servlet/*
    </url-pattern>
    </servlet-mapping>it works just fine. Can anyone explain to me why this is since I've seen web.xml files that don't use the /* for the dir. location?
    Thanks in advance.

    I posted this too soon. Using that 'wild card' it grabs the last servlet mapped in web.xml. So I commented everything out and left the file with the following(I used '*' just to keep stuff private):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
        <display-name>DISPLAY NAME</display-name>
        <description>
         DISPLAY NAME
        </description>
       <servlet>
    <servlet-name>SignIn</servlet-name>
        <servlet-class>lmt.SignIn</servlet-class>
    <init-param>
          <param-name>url</param-name>
          <param-value>jdbc:mysql://localhost/********</param-value>
        </init-param>
        <init-param>
          <param-name>**********</param-name>
          <param-value>*******</param-value>
        </init-param>
        <init-param>
          <param-name>********</param-name>
          <param-value>***********</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>
    SignIn
    </servlet-name>
    <url-pattern>
    /servlet/SignIn
    </url-pattern>
    </servlet-mapping>
    </web-app>This is will not locate the servlet.
    I get a 404 with this message: "type Status report
    message /servlet/SignIn/
    description The requested resource (/servlet/SignIn/) is not available.
    I really have no idea what's wrong here. Is there a problem with some configuration elsewhere? Thanks again.

  • Question on web.xml in OAF

    Hi Friends,
    when i open web.xml in jdeveloper window, i can able to see my application(instance) user name and pass word.
    what can i do to remove my password in web.xml. is there any set up to do for instead of displaying password name display as some *****************.
    Thanks in advance,
    vamshi.

    Hi Reetesh,
    Thank you.
    atleat can we hide this below part in web.xml..
    <context-param>
    <param-name>OA_LOGIN_PASSWORD</param-name>
    <param-value>krishna12</param-value>
    </context-param>
    Regards,
    vamshi.

  • Web.xml - security constraint question

    I want to make a kind of inverted security constraint. I want to ALLOW access to one specific page over HTTP. All other pages should be HTTPS.
    Is that possible???

    Use the <security-role-ref> for the Faces Servlet to map the LDAP roles to the logical role names used by the managed bean to determine if links may be rendered.
    Bean code:
    this.isAdmin = context.getExternalContext().isUserInRole("admin");web.xml:
            <security-role>
              <role-name>Local Admin Group</role-name>
         </security-role>
         <security-role>
              <role-name>DBA Group</role-name>
         </security-role>
        <!-- Faces Servlet -->
        <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <security-role-ref>
                  <role-name>admin</role-name>
                  <role-link>DBA Group</role-link>
           </security-role-ref>
            <security-role-ref>
                  <role-name>admin</role-name>
                  <role-link>Local Admin Group</role-link>
           </security-role-ref>
        </servlet>

  • Web.xml servlet redirection question

    Hi everyone;
    As you know web.xml file allows you to enter something like this
         <servlet-mapping>
              <servlet-name>application1</servlet-name>
              <url-pattern>/application1</url-pattern>
         </servlet-mapping>
    so you can find your application.
    As you know it is case sensitive so if a user enters /Application1 it wouldn't be found. I was wondering if i could put a node in there that would redirect requests from Application1 to application.
    Any ideas ?
    Stev

    oh i wasn't aware that i could put multiple nodes in there like this
    <servlet-mapping>
    <servlet-name>application1</servlet-name>
    <url-pattern>/application1</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>application1</servlet-name>
    <url-pattern>/Application1</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>application1</servlet-name>
    <url-pattern>/APplication1</url-pattern>
    </servlet-mapping>
    is there a way to simply make this case insensitive and all requests get translated to the lowercase versioN?
    Stev

Maybe you are looking for

  • K7T Turbo-R Limited Edition

    Ok fellas, here's my question. I'll try to include as much info as possible here. I have the K7T Turbo-R Limited Edition version 3.0A (at least that's what the users manual says). It's a  Red Motherboard  and has 2 IDE Controllers. I simply want to k

  • Fresh update of 7.0.4 and freezes on Restoring Ipad Firmware

    Hi i recently did a factory reset in my ipad 2 and it was taking time, so i put the ipad in dfu mode and plugged it in the computer to do a fresh update 7.0.4 and now it freezes on Restoring Ipad Firmware. after about 30 mins get an iTunes error. HEL

  • How To Get the RealPath of Web in a WebService

    I know get it in jsp: String rootPath = request.getRealPath("/"); But I don't know how to get it in a WebService. Who can help me,thank you very much.

  • HT2822 How do I show a web page from my iPad on my tv?

    I am trying to sync my iPad 3 with my tv using apple tv so I can see whatever is on my iPad on my tv screen - I have managed photos but I can't get web pages? Can anyone help ?

  • "method not found in class " error message !

    Dear People, I have an error message that says: "Clerk.java": Error #: 300 : method doTransaction(stan_ch15p622.Transaction) not found in class stan_ch15p622.Bank at line 36, column 12 below is the Clerk class of the program. doTransaction() is defin