Erro pagina JSF ....Namespace prefix sec on ifAnyGranted is not defined

1 resposta
P

Olá,

estou fazendo teste em uma página JSF e me apresentou esse errono browser abaixo e não estou
conseguindo visualizar esse erro.

Alguém já passou por esse erro.

abs

no Eclipse na linha xmlns:sec="http://www.springframework.org/security/facelets/tags"> apresenta essa mensagem NLS missing message: CANNOT_FIND_FACELET_TAGLIB in: org.eclipse.jst.jsf.core.validation.internal.facelet.messages

This page contains the following errors:

error on line 19 at column 25: Namespace prefix sec on ifAnyGranted is not defined
error on line 29 at column 29: Namespace prefix sec on ifAnyGranted is not defined
Below is a rendering of the page up to the first error.
<?xml version="1.0"  ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

<head>
<title>Principal</title>
</head>
<body>

  <h1>Gerenciador Financeiro Pessoal</h1>
      Usuário logado : #{request.remoteUser}
<br/>      
      Nome do Usuário Logado #{contextoBean.usuarioLogado.nome}
<br/>

  &lt;h:form&gt;
  
  
   &lt;h:commandButton value="Conta" action="conta"/&gt;
   
   &lt;h:selectOneMenu  value="#{contextoBean.contaAtiva.conta}" 
            valueChangeListener="#{contextoBean.setContaAtiva}"
            rendered="#{!empty contextoBean}"
            onchange="submit()"    &gt;
            &lt;f:selectItems value="#{contaBean.lista}" var="conta" itemValue="#{conta.conta}" itemLabel="#{conta.descricao}"/&gt;
   &lt;/h:selectOneMenu&gt;
   
    &lt;sec:ifAnyGranted roles="ROLE_ADMINISTRADOR"&gt;
    
      &lt;h:commandButton action="/admin/principal" value="Administrativo"/&gt;
             
    &lt;/sec:ifAnyGranted&gt;
    
   &lt;input type="button" value="Logout" onclick="document.location='#{request.contextPath}/j_spring_security_logout'"/&gt;
   
  &lt;/h:form&gt;

&lt;/body&gt;
&lt;/html&gt;

1 Resposta

P
INFO: Server startup in 13967 ms
09/02/2011 14:04:56 com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [/FinanceiroWeb] Os ELResolvers para JSF não foram registrados com o contêiner JSP.
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
  &lt;display-name&gt;FinanceiroWeb&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  &lt;servlet&gt;
    &lt;display-name&gt;FacesServlet&lt;/display-name&gt;
    &lt;servlet-name&gt;FacesServlet&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;servlet-mapping&gt;
    &lt;servlet-name&gt;FacesServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
&lt;filter&gt;
   &lt;filter-name&gt;conexaoFilter&lt;/filter-name&gt;
   &lt;filter-class&gt;financeiro.web.filter.ConexaoHibernateFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;conexaoFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  	&lt;!-- JNDI --&gt;
  	&lt;resource-ref&gt;
		&lt;description&gt;DataSource FinaceiroBD&lt;/description&gt;
		&lt;res-ref-name&gt;jdbc/FinanceiroDB&lt;/res-ref-name&gt;
		&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
		&lt;res-auth&gt;Container&lt;/res-auth&gt;
	&lt;/resource-ref&gt;
  
  
  	&lt;!-- Spring Security --&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
		&lt;param-value&gt;
			/WEB-INF/applicationContext.xml
			/WEB-INF/applicationContext-security.xml
		&lt;/param-value&gt;
	&lt;/context-param&gt;
  	&lt;filter&gt;
		&lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
		&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
	&lt;/filter&gt;

	&lt;filter-mapping&gt;
		&lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
		&lt;url-pattern&gt;/*&lt;/url-pattern&gt;
	&lt;/filter-mapping&gt;

	&lt;listener&gt;
		&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
	&lt;/listener&gt;
  
    &lt;context-param&gt;
		&lt;param-name&gt;com.sun.faces.expressionFactory&lt;/param-name&gt;
		&lt;param-value&gt;com.sun.el.ExpressionFactoryImpl&lt;/param-value&gt;
	&lt;/context-param&gt;
  
&lt;/web-app&gt;
Criado 9 de fevereiro de 2011
Ultima resposta 9 de fev. de 2011
Respostas 1
Participantes 1