Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use jsp and xhtml files in an application  RSS feed

 
vinutha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is web.xml file,


<web-app>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<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>*.jsf</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>

</web-app>

If i configure like this, i am not able to work with jsp file.
So, how to configure web.xml file to work with both jsp and xhtml file.

Thanks,
Vinutha.
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. I don't see anything in there that would keep JSPs from working. That would only happen if you told the Faces Servlet to intercept URLs ending in ".jsp". Otherwise, URLs ending with ".jsf" should be routed to the Faces Servlet and URLs ending with ".jsp" should be routed to the servlet that would be produced by compiling the corresponding JSP file.
 
vinutha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i wont configure this context-param in web.xml, then i can work with only jsp files.
but, now i want to work with both jsp and xhtml files.
To work with xhtml, we need to configure web.xml like this,

<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

If i configure my web.xml with above context-param, then i am not able to work with jsp files,

So, how to work with both jsp and xhtml files in a single application,

Thanks,
Vinutha.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!