File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

default.jsp

 
baran tamer
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello , i am trying to configure a default page

my default page is at



and my web.xml file includes



when i type

http://localhost:8181/baran/


the error is

org.apache.jasper.JasperException: java.lang.RuntimeException: FacesContext not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.ardic.web.EncodingFilter.doFilter(EncodingFilter.java:34)




What would be the problem ?
thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have JSF components in the welcome page, but the FacesServlet isn´t been invoked by the specific URL so it can´t create the FacesContext. The JSF components are complaining that they cannot find the FacesContext.

Create an index.jsp with a jsp:forward to default.jsf and only mention the index.jsp in the welcome file list.
 
baran tamer
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


my index.jsp is



when i start index,jsp it redirects to default.jsp , but when i type

http://localhost:8181/baran/


i get the same error

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
baran tamer wrote:

In your other topic you said that you successfully changed it to *.jsf.


my index.jsp is



when i start index,jsp it redirects to default.jsp , but when i type

http://localhost:8181/baran/


i get the same error


default.jsf, I said default.jsf.

And you should not be using JSF in the welcome page (you should already realize that if you understood the exception). Leave all of those clutter away. Just use jsp:forward, nothing more.
 
baran tamer
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i missread your post
 
baran tamer
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot it works,

But what if i had not changed it to *.jsf and kept it as /faces/* ?
Is there any way to do that ?
Which will be better for my project , cause i need to do lots of redirect modifications

BTW : Solution was just putting the jsp:forward in the index.jsp as you told me
thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
baran tamer wrote:thanks a lot it works,

But what if i had not changed it to *.jsf and kept it as /faces/* ?
Is there any way to do that ?
Then obviously forward to /faces/default.jsp instead of default.jsf.

I only have read in your another topic that you wanted suffix mapping rather than prefix mapping and saw that you successfully have changed it. So I just changed my answer on that .. Call it advancing understanding.

Which will be better for my project , cause i need to do lots of redirect modifications

I don´t dare to say, it depends on your functional requirements.

If I would start a brand new JSF project, I would prefer suffix mapping over prefix mapping.

BTW : Solution was just putting the jsp:forward in the index.jsp as you told me
thanks

You´re welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic