Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JSF Servlet mapping problem

Reply
Thread Tools

JSF Servlet mapping problem

 
 
Liming
Guest
Posts: n/a
 
      11-29-2005
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.

 
Reply With Quote
 
 
 
 
hiwa
Guest
Posts: n/a
 
      11-29-2005
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://hostort/company/test1/test.jsp

I haven't tried it though.
Will you post the result.

 
Reply With Quote
 
 
 
 
Liming
Guest
Posts: n/a
 
      11-30-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Include JSF page within another JSF page BlackIce Java 1 07-05-2006 11:24 PM
JSF debugging / JSF newsgroup Sebastian Fey Java 1 04-07-2006 08:52 PM
[JSF]Need to deploy a jsf application on SunApplicationServer. dudu Java 0 03-03-2006 12:09 PM
JSF and Servlet Liming Java 1 12-14-2005 11:09 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM



Advertisments