facebook

Package Problem in Web.xml Servlet URL Pattern

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #281687 Reply

    grungefreak1
    Member

    Hi,

    Each time I create a new file within a package within a project, when I call the servlet e.g. http://host/servlet/package.Servlet, it never works. When I leave out the package name in the URL it does work. Why is this?

    I can work around it by editing the web application web.xml file. The <url-pattern> tag must be edited and the package name inserted into it in order for me to be able to call my servlet with the package name in the URL. I don’t think I should really have to do this though. Is there something I am missing on the config?

    GF

    #281703

    Loyal Water
    Member

    The <url-pattern> tag associates a servlet with a URL. When a request arrives, the container uses a simple procedure for matching the URL in the request with a url-pattern in the web.xml.

    What your doing is not a worksround. Thats the way a servlet is mapped to a URL.

    #281731

    grungefreak1
    Member

    @support-nipun wrote:

    The <url-pattern> tag associates a servlet with a URL. When a request arrives, the container uses a simple procedure for matching the URL in the request with a url-pattern in the web.xml.

    What your doing is not a worksround. Thats the way a servlet is mapped to a URL.

    OK, but should I really have to enter the package name in the mappings?shouldn’t that happen when I create the servlet i.e. shouldn’t the web.xml file be written to with the fully qualified name of the servlet (package name included)?

    GF

    #281754

    Loyal Water
    Member

    Mapping the servlet is a manual process. It doesn’t happen automatically.

    #281821

    grungefreak1
    Member

    @support-nipun wrote:

    Mapping the servlet is a manual process. It doesn’t happen automatically.

    Ok thanks. But each time I restart the Server,the mapping defaults back to the original setting i.e. it deletes the package name from the URL Patternand I have to change the mappings again. Does anyone know why this is happening?

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Package Problem in Web.xml Servlet URL Pattern

You must be logged in to post in the forum log in