まず第一に、私はJSPの初心者です:)。今日、バージョン 1.2 の JSTL を使用しようとしています。xml に情報を含め、pom に依存関係を含めました。<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
jspにもあります。
表示されるエラーメッセージは次のとおりです。このアプリケーションで
以前のフォーラムの投稿を読み直しましたが、これまでのところ何も役に立ちませんでした。実際、異なる投稿は異なることを示唆しています。したがって、簡単なチュートリアルは非常に高く評価されます:)。
ありがとうございます!私のweb.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
</web-app>
私のindex.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="c" uri="http:/ /java.sun.com/jsp/jstl/core" %> JSTL 関数
<c:out value="this is simply some text" />
<br>
<dependencies>
<!-- JUnit to run the tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<!-- Java servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<!-- Velocity templating engine -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
デプロイされたアプリの構造:
- テスト
- index.jsp
- メタINF
- WEB-INF
- クラス
- ライブラリ
- commons-collections-3.2.1.jar
- commons-lang-2.4.jar
- jstl-1.2.jar
- 速度-1.7.jar
- web.xml
- test.war