java - how to access http://www.myjsfapp.com/index.html in a jsf app? -


this question has answer here:

in browser url bar welcome page of jsf app appears like:

http://www.myjsfapp.com/ 

i'd need access as:

http://www.myjsfapp.com/index.html 

for purpose of passing parameters:

http://www.myjsfapp.com/index.html?param=value 

but http://www.myjsfapp.com/index.html gives me 404.

what missing?

note: web.xml:

<welcome-file-list>         <welcome-file>faces/index.xhtml</welcome-file> </welcome-file-list> 

there no index.html file in project. welcome page index.xhtml. take attention between xhtml , html.

furthermore, if have servlet mapping /faces/* in web.xml. index.xhtml should accessed http://myjsfapp.com/faces/index.xhtml?param=value. possible access http://myjsfapp.com/ index.xhtml?param=value, url not have jsf capabilities.

once add servlet mapping

<servlet>     <servlet-name>faces servlet</servlet-name>     <servlet-class>javax.faces.webapp.facesservlet</servlet-class>     <load-on-startup>1</load-on-startup>   </servlet>    <servlet-mapping>     <servlet-name>faces servlet</servlet-name>     <url-pattern>/faces/*</url-pattern>   </servlet-mapping> 

the request includes /faces/* patterns in url controlled mapped servlet. faces servlet , controlled javax.faces.webapp.facesservlet class. servlet mapping give requests jsf capability. other urls not having /faces/* not run inside faces servlet meaning there no jsf capability.


Comments