tente limpar o seu web.xml colocando somente os campos essenciar para executar a base do seu projeto e depois vai colocando o restante da configuração é o jeito mais facil de achar o erro
Quando tento rodar minha aplicação esta gerando esse erro:
[quote]org.apache.jasper.JasperException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to *.jsf (with the -element), you need to access your pages as ‘sample.jsf’. If you tried to access ‘sample.jsp’, you’d get this error-message.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to *.jsf (with the -element), you need to access your pages as ‘sample.jsf’. If you tried to access ‘sample.jsp’, you’d get this error-message.
javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:926)
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:313)
org.apache.jsp.jsp.login_jsp._jspx_meth_h_commandLink_0(login_jsp.java:92)
org.apache.jsp.jsp.login_jsp._jspService(login_jsp.java:64)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
[/quote]
Meu web.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
sisrs
Comma separated list of URIs of (additional) faces config files.
(e.g. /WEB-INF/my-config.xml)
See JSF 1.0 PRD2, 10.3.2
Attention: You do not need to put /WEB-INF/faces-config.xml in here.
javax.faces.CONFIG_FILES
/WEB-INF/managed-bean-config.xml
com.sun.faces.verifyObjects
false
com.sun.faces.validateXml
true
This parameter tells MyFaces if javascript code should be allowed in the
rendered HTML output.
If javascript is allowed, command_link anchors will have javascript code
that submits the corresponding form.
If javascript is not allowed, the state saving info and nested parameters
will be added as url parameters.
Default: "true"
org.apache.myfaces.ALLOW_JAVASCRIPT
true
org.apache.myfaces.DETECT_JAVASCRIPT
false
If true, rendered HTML code will be formatted, so that it is “human readable”.
i.e. additional line separators and whitespace will be written, that do not
influence the HTML code.
Default: "true"
org.apache.myfaces.PRETTY_HTML
false
Validate managed beans, navigation rules and ensure that forms are not nested.
org.apache.myfaces.VALIDATE
true
javax.faces.STATE_SAVING_METHOD
client
A very common problem in configuring MyFaces-web-applications
is that the Extensions-Filter is not configured at all
or improperly configured. This parameter will check for a properly
configured Extensions-Filter if it is needed by the web-app.
In most cases this check will work just fine, there might be cases
where an internal forward will bypass the Extensions-Filter and the check
will not work. If this is the case, you can disable the check by setting
this parameter to false.
org.apache.myfaces.CHECK_EXTENSIONS_FILTER
true
Change the url-pattern from the ExtensionsFilter
Default is "/faces/myFacesExtensionResource"
Note: The filter-mapping for ExtensionsFilter, the url-pattern is
this value + "/", else there comes a exception
org.apache.myfaces.RESOURCE_VIRTUAL_PATH
/faces/extensionResource
This parameter enables partial state saving.
javax.faces.PARTIAL_STATE_SAVING_METHOD
false
If true every time a page is rendered, the corresponding JSP is dispatched also.
This is very usefull if Scriptlets are used inside the JSP.
javax.faces.PARTIAL_STATE_SAVING_DISPATCH_EVERY_TIME
true
dir.upload
/temp/
extensionsFilter
org.apache.myfaces.webapp.filter.ExtensionsFilter
Set the size limit for uploaded files.
Format: 10 - 10 bytes, 10k - 10 KB, 10m - 10 MB, 1g - 1 GB
uploadMaxFileSize
100m
Set the threshold size - files
below this limit are stored in memory, files above
this limit are stored on disk.
Format: 10 - 10 bytes, 10k - 10 KB, 10m - 10 MB, 1g - 1 GB
uploadThresholdSize
250k
extensionsFilter
/faces/
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<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>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<resource-ref>
<res-ref-name>jdbc/MySqlDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<mime-mapping>
<extension>csv</extension>
<mime-type>application/csv</mime-type>
</mime-mapping>
<error-page>
<error-code>403</error-code>
<location>/erroLogin.html</location>
</error-page>
[/code]
Meu faces-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<locale-config>
<default-locale>pt_BR</default-locale>
<supported-locale>pt_BR</supported-locale>
</locale-config>
<message-bundle>sisfmanager</message-bundle>
</application>
<navigation-rule>
<from-view-id>/jsp/login.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/jsp/principal/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Portanto, se eu tento acessar minha jsp sem esse codigo:
[code]<%@ taglib prefix=“f” uri=“http://java.sun.com/jsf/core” %>
<%@ taglib prefix=“h” uri=“http://java.sun.com/jsf/html” %>
<%@ taglib prefix=“t” uri=“http://myfaces.apache.org/tomahawk”%>
teste
[/b] [/color] [/code] Funciona.. o que aconteceu que quando uso qualquer taglib ta dando erro. os jar do myfaces, tomahawk estao no classpath do projeto.Boa noite,
despois de muita pesquisa, e sem solução alguma resolvi estudar jsf um pouco…
Então descobri que é necessario passar por dentro do contexto /faces/ pra “ativar” o faces context e conseguir utilizar de seus recursos.
Então modifiquei meu web.xml para atender isso colocando assim:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
e meu index.html
<script language="JavaScript">
window.open("/sisf/faces/jsp/login.jsp",'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=800,height=600,screenX=150,screenY=150,top=150,left=150')
window.close();
</script>
Note que passo por dentro do contexto /faces/ a partir dai consigo utilizar de todos os recursos dele.
Abraços.