Problemas com Tomahawk + MyFaces

2 respostas
R

Pessoal, estou enfrentando o seguinte problema :
Nosso projeto só consegue renderizar tomahawk (jscook, inputCalendar, etc…) na máquina onde está o servidor do Tomcat ou no Firefox, no ie 6 ou 7 dá um erro de javascript dizendo que não foi possivel localizar org_apache_myfaces_inputCalendar… e com os outros componentes a mesma coisa.
Fiz o mapeamento do ExtensionFilter no web.xml igualzinho como está no site da Apache, criei um tamahawk.taglib.xml como explica no site e nada… por favor alguém já passou por isso e pode me ajudar ??
Grato…

2 Respostas

R

Pode ser cache, tente limpar os diretórios temporarios do tomcat!
Tente também verificar se não tem nenhum outro código javascript contendo erro na mesma pagina.
Outra alternativa, se vc usa algum filtro pra bloquear acessos, tem que liberar essas urls
/faces/myFacesExtensionResource/*
tive problemas pq meu filtro bloqueava todos os resources q o tomahawk queria usar

R

Segue o meu web.xml para análise, continuo na mesma…
Obrigado…

&lt?xml version="1.0"?&gt

<!–

  • Copyright 2004 The Apache Software Foundation.
  • Licensed under the Apache License, Version 2.0 (the “License”);
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
  • http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an “AS IS” BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.
    –>

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
http://java.sun.com/dtd/web-app_2_3.dtd”>

<web-app>

&lt;!-- This web.xml can be used during debugging, when there is no myfaces.jar
    library available.

    The faces-config.xml file (that is normally in the myfaces.jar) must be
    copied to the /WEB-INF directory of the web context.

    The TLDs (that are normally in the myfaces.jar) must be
    copied to the /WEB-INF/lib directory of the web context.--&gt;
&lt;description&gt;debug web.xml&lt;/description&gt;

&lt;context-param&gt;
    &lt;param-name&gt;javax.faces.CONFIG_FILES&lt;/param-name&gt;
    &lt;param-value&gt;
        /WEB-INF/faces-config.xml
    &lt;/param-value&gt;
    &lt;description&gt;
        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
    &lt;/description&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;facelets.LIBRARIES&lt;/param-name&gt;
    &lt;param-value&gt;/WEB-INF/tomahawk.taglib.xml&lt;/param-value&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
    &lt;param-value&gt;client&lt;/param-value&gt;
    &lt;description&gt;
        State saving method: "client" or "server" (= default)
        See JSF Specification 2.5.2
    &lt;/description&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.ALLOW_JAVASCRIPT&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;description&gt;
        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"
    &lt;/description&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.DETECT_JAVASCRIPT&lt;/param-name&gt;
    &lt;param-value&gt;false&lt;/param-value&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.PRETTY_HTML&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;description&gt;
        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"
    &lt;/description&gt;
&lt;/context-param&gt;

&lt;context-param&gt;
    &lt;param-name&gt;org.apache.myfaces.AUTO_SCROLL&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;description&gt;
        If true, a javascript function will be rendered that is able to restore the
        former vertical scroll on every request. Convenient feature if you have pages
        with long lists and you do not want the browser page to always jump to the top
        if you trigger a link or button action that stays on the same page.
        Default: "false"
    &lt;/description&gt;
&lt;/context-param&gt;

&lt;!-- Extensions Filter --&gt;
&lt;filter&gt;
    &lt;filter-name&gt;extensionsFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;org.apache.myfaces.component.html.util.ExtensionsFilter&lt;/filter-class&gt;
    &lt;init-param&gt;
        &lt;param-name&gt;uploadMaxFileSize&lt;/param-name&gt;
        &lt;param-value&gt;100m&lt;/param-value&gt;
        &lt;description&gt;Set the size limit for uploaded files.
            Format: 10 - 10 bytes
                    10k - 10 KB
                    10m - 10 MB
                    1g - 1 GB
        &lt;/description&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
        &lt;param-name&gt;uploadThresholdSize&lt;/param-name&gt;
        &lt;param-value&gt;100k&lt;/param-value&gt;
        &lt;description&gt;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
        &lt;/description&gt;
    &lt;/init-param&gt;

<!-- <init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
<description>Set the path where the intermediary files will be stored.
</description>
</init-param>–>
</filter>

&lt;filter&gt;
&lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
&lt;filter-class&gt;org.apache.myfaces.webapp.filter.ExtensionsFilter&lt;/filter-class&gt;
&lt;init-param&gt;
    &lt;param-name&gt;maxFileSize&lt;/param-name&gt;
    &lt;param-value&gt;20m&lt;/param-value&gt;
    &lt;description&gt;Set the size limit for uploaded files.
        Format: 10 - 10 bytes
                10k - 10 KB
                10m - 10 MB
                1g - 1 GB
    &lt;/description&gt;
&lt;/init-param&gt;
&lt;/filter&gt;


&lt;!-- extension mapping for adding &lt;script/&gt;, &lt;link/&gt;, and other resource tags to JSF-pages  --&gt;
&lt;filter-mapping&gt;
	&lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
    &lt;!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry --&gt;
	&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
&lt;/filter-mapping&gt;

&lt;!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  --&gt;
&lt;filter-mapping&gt;
	&lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;
&lt;filter-mapping&gt;
	&lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/faces/myFacesExtensionResource/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;


&lt;filter-mapping&gt;
    &lt;filter-name&gt;extensionsFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;
&lt;filter-mapping&gt;
    &lt;filter-name&gt;extensionsFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;


&lt;!-- Faces Servlet --&gt;
&lt;servlet&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;

&lt;!-- Faces Servlet Mapping --&gt;

&lt;!-- virtual path mapping --&gt;
&lt;!-- 
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
--&gt;

&lt;!-- extension mapping --&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

&lt;!-- Welcome files --&gt;

&lt;welcome-file-list&gt;
    &lt;welcome-file&gt;CadFunc.jsp&lt;/welcome-file&gt;
&lt;/welcome-file-list&gt;

</web-app>

Criado 4 de maio de 2007
Ultima resposta 6 de mai. de 2007
Respostas 2
Participantes 2