Results 1 to 4 of 4
  1. #1
    emosms is offline Member
    Join Date
    May 2010
    Posts
    29
    Rep Power
    0

    Default servlet takes over the index page

    Hi
    I declared a servlet in my application's web.xml
    the problem is that, the application starts with the servlet right away and not with the index.jsp page
    the intention is that the servlet gets parameters from index.jsp - the starting page
    also added at the end of web.xml
    Java Code:
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    but still it won't render index.jsp
    Any suggestions? Stuck at start

    Best Regards

  2. #2
    emosms is offline Member
    Join Date
    May 2010
    Posts
    29
    Rep Power
    0

    Default Re: servlet takes over the index page

    well, tomcat simply dont see my web pages
    it starts right away with the servlet
    so I decided to create Init.servlet and use:
    response.sendRedirect("/index.jsp");
    - but NOPE again, it might work but if I put my pages into the tomcat root :) (the example above redirects to tomcat welcome page)
    - so again, it does not read pages from my web folder
    If I append:
    response.sendRedirect("MyContentPath/index.jsp");
    then I get some infinite requests loop and browser never reach the resource
    - which xml or whatever should I edit, so that tomcat 'sees' my pages when using web.xml?

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: servlet takes over the index page

    How have you defined your servlet in the web.xml.
    It looks to me like you've essentially told Tomcat to treat everything as your servlet.
    Please do not ask for code as refusal often offends.

  4. #4
    nicephotog is offline Member
    Join Date
    Mar 2012
    Posts
    41
    Rep Power
    0

    Default Re: servlet takes over the index page

    Look for an include or forward or any scripting you possibly leaved behind in the index.jsp that points to the servlet.

Similar Threads

  1. how to call servlet from the very first jsp page
    By R O C K Y in forum Advanced Java
    Replies: 6
    Last Post: 07-04-2012, 04:20 PM
  2. redirect to a servlet page
    By niteangell21 in forum New To Java
    Replies: 5
    Last Post: 11-15-2010, 02:53 PM
  3. Replies: 0
    Last Post: 06-07-2008, 09:02 PM
  4. how to load a servlet on index.jsp page...
    By sujithc34 in forum Java Servlet
    Replies: 1
    Last Post: 01-19-2008, 12:28 AM
  5. Servlet calling JSP page
    By gapper in forum Java Servlet
    Replies: 1
    Last Post: 01-15-2008, 04:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •