JSF Servlet mapping problem

Discussion in 'Java' started by Liming, Nov 29, 2005.

  1. Liming

    Liming Guest

    Hello,

    I'm new creating JSF application and I have a problem with the servlet
    mapping.

    My directory looks something like this

    /company

    /test1
    test.jsp
    /test2
    /web-inf

    I wanne map all requrest from /test1 to JSF, so i did something liek
    this

    .....
    <servlet-mapping>
    ....
    <url-pattern>/test1/*</url-pattern>
    </servlet-mapping>

    when I accessed the url via http://localhost:9080/test1/test.jsp, the
    server tried to look for http://localhost:9080/test.jsp instead.

    I can see the JSF servlet is taking the part of the url after the
    "/test1/", how do I get around it? I suppose I could change the url
    pattern to "/faces/*" and then access via
    "http://localhost:9080/faces/test1/test.jsp", but I don't like to see
    /faces in the url.
    Please help.

    Thank you all so much.
     
    Liming, Nov 29, 2005
    #1
    1. Advertising

  2. Liming

    hiwa Guest

    That behavior is based on servlet specification
    for <servlet-mapping> semantics, because with
    your URL, the server regards 'test1' as the
    context path.

    Solution might be:
    http://host:port/company/test1/test.jsp

    I haven't tried it though.
    Will you post the result.
     
    hiwa, Nov 29, 2005
    #2
    1. Advertising

  3. Liming

    Liming Guest

    thanks. Yes, if I did the url-pattern as /company/*, that will work
    and look prettier.

    I ended up configuring *.faces though and accessed the page via
    /test/test.faces.

    Thanks again.
     
    Liming, Nov 30, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    2,022
    Jack Jia
    Apr 4, 2004
  2. sods
    Replies:
    5
    Views:
    2,746
  3. dudu
    Replies:
    0
    Views:
    384
  4. Sebastian Fey

    JSF debugging / JSF newsgroup

    Sebastian Fey, Apr 7, 2006, in forum: Java
    Replies:
    1
    Views:
    7,635
    Danno
    Apr 7, 2006
  5. BlackIce
    Replies:
    1
    Views:
    17,185
Loading...

Share This Page