Zack
cookies vader
Hallo,
ich bin gerade dabei mittels JSP eine XML-Datei aus zu lesen. Dazu möchte ich gerne die Tag-Libs von Sun benutzen. Ich habe nach ein wenig googlen auch eine Möglichkeit gefunden, allerdings will das nicht ganz so wie in dem BSP.:
Hier mal das Wesentliche aus mein Code:
Dies führt allerdings zu einer Exeption mit der ich nicht viel anfangen kann.
Eine wenig googlelei hat ergeben das es an meiner in die web.xml eingetragene Version handeln kann, bzw ich die falschen Libs eingebunden habe. Die Frage ist jetzt also, wie muss meine web.xml aussehen und wie binde ich die richtigen Libs ein?
Meine web.xml sieht atm so aus:
Vielen Dank, Zack
ich bin gerade dabei mittels JSP eine XML-Datei aus zu lesen. Dazu möchte ich gerne die Tag-Libs von Sun benutzen. Ich habe nach ein wenig googlen auch eine Möglichkeit gefunden, allerdings will das nicht ganz so wie in dem BSP.:
Hier mal das Wesentliche aus mein Code:
HTML:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<c:import var="file" url="daten.xml" />
<x:parse var="foo" xml="${file}" />
</body>
</html>
Code:
org.apache.jasper.JasperException: /dvd.jsp (line: 24, column: 4) According to TLD or attribute directive in tag file, attribute xml does not accept any expressions
Meine web.xml sieht atm so aus:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
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_3_0.xsd"
version="3.0"
metadata-complete="true">
<display-name>JSP - BSP</display-name>
<description>
JSP Beispiele
</description>
</web-app>
Vielen Dank, Zack
Zuletzt bearbeitet von einem Moderator: