This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes using XHTML & JSP in the same application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "using XHTML & JSP in the same application" Watch "using XHTML & JSP in the same application" New topic
Author

using XHTML & JSP in the same application

Mohamed Hedi Abidi
Greenhorn

Joined: Jun 28, 2011
Posts: 3
Hi,

I want to use JSF2 in my existing project based on JSP/Servlet
I started migrating my olds JSPs on xhtml pages, when I try to navigate from page1.xhtml to page2.jsp, page extension change automatically to page2.xhtml
And then, I have this error message: /jsp/page2.xhtml Not Found in ExternalContext as a Resource
Which is logical, because there is not page2.xhtml


in page1.xhtml i have something like this


in my faces-config.xml i have this navigation rule :


in web.xml, I use 2 servlets mapping :
- *.xhtml for Faces Servlet
- *.jsp for old Servlet





Can you help please!

Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
If I understand your problem correctly you are not using any "JSF stuff" on your jsp pages? I presume so since in your web.xml you use normal servlets for jsp pages.
In that case you do not need to use the p:commandLink or any other "JSF stuff" to move from JSF page to normal JSP page. You can use pure html.
Sorry if I did not understand your problem
Mohamed Hedi Abidi
Greenhorn

Joined: Jun 28, 2011
Posts: 3
thanks Ilari Moilanen,
I have found the solution,
The problem is that faces-config.xml is used automatically by Faces Servlet, that's why I am redirected to page2.xhtml
Many nice ways to solve the problem :
- in baking bean:

- or using html in jsf page (like you did) :
 
GeeCON Prague 2014
 
subject: using XHTML & JSP in the same application