【发布时间】:2011-08-22 09:23:42
【问题描述】:
我正在使用 JSF 2.0、Maven 2、Springframework 3 和 Glassfish 3。我正在尝试使用 FixedThemeResolver,但我无法将标签插入到 facelet 中。我写了一个这样的页面:
<?xml version='1.0' encoding='utf-8'?>
<!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:em="http://java.sun.com/jsf/composite/emcomp"
xmlns:st="http://www.springframework.org/tags">
<head>
<link href="${facesContext.externalContext.requestContextPath}/files/basic.css" rel="stylesheet" type="text/css" media="all"/>
<title><ui:insert name="title">Default Title</ui:insert></title>
</head>
<body>
<h1><ui:insert name="heading">Default heading</ui:insert></h1>
<p><st:theme code='css' /></p>
<em:komponenta textik="Experimental component"/>
<ui:insert name="content" />
<hr/>
<i>${appVersion}</i>
<ui:include src="/WEB-INF/templates/footer.xhtml" />
</body>
</html>
它不起作用。在 Eclipse 中,我收到一条警告,指出名称空间 http://www.springframework.org/tags 没有任何标记库。在 Web 浏览器中,我收到 警告:此页面调用 XML 命名空间 http://www.springframework.org/tags 声明,前缀为 st,但该命名空间不存在标记库。
我已经在 pom.xml 中声明了对 Spring MVC 的依赖:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
应该够了,但似乎不是。非常感谢任何提示。
【问题讨论】:
标签: maven-2 spring-mvc jsf-2