1

这是我第一次尝试使用 JSP,但在最后一行的链接中出现解析错误。我已经有一个“;”。

<%@page contentType="application/atom+xml; charset=utf-8" %><%
String
baseURL = request.getScheme() + "://" + request.getServerName() +
request.getServerPort()+ ":" + request.getContextPath();
Integer id=0;
String link="";
%>

<feed xsi:schemaLocation="http://www.w3.org/2005/Atom ../XMLschemas/atom/atom.xsd"
    xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <title type="text">1</title>
    <id><%=baseURL%></id>
    <updated>2012-04-23T15:49:17Z</updated>
    <link rel="self"
        href="https://example.com" />
    <entry>
        <id><%link = baseURL + "/" + Integer.toString(++id); %><%=link%></id>

在 Weblogic 中:

feed.jsp:69:16: Syntax error, insert ";" to complete Statement
                <id><%link = "good_subjectdoc_relativeurl.xml"%></id>

饲料的其余部分:

    <title type="text">good_subjectdoc_absoluteurl_samebase_singledocname.xml
        </title>
        <updated>2012-04-23T15:49:17Z</updated>
        <author>
            <name>TEST</name>
        </author>
        <contributor>
            <name>TEST</name>
        </contributor>
        <link rel="alternate" type="application/xml" title="Subject Document"
            href="<%=link%>" />
            <category term="TEST" />
                <content>
                                    Content             
                              </content>
    </entry>

4

1 回答 1

1

feed.jsp:69:16:语法错误,插入“;” 完成声明

正如错误所说,您需要;在以下行中插入以完成语句:

<id><%link = "good_subjectdoc_relativeurl.xml"%></id>

因此,所以:

<id><%link = "good_subjectdoc_relativeurl.xml";%></id>
于 2012-04-23T19:04:15.027 回答