2012-04-23 4 views
1

JSP를 사용하여 처음 시도했을 때 마지막 행의 링크에서 구문 분석 오류가 발생합니다. 나는 이미 ";"을 가지고있다. 웹 로직에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> 

:

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> 

+0

인가 전체 JSP인가? ''를 닫으시겠습니까? – bvulaj

+0

@BrandonV, 예 입력을 마감했습니다. 위의 나머지 피드를 붙여 넣었습니다. – user994165

답변

1

feed.jsp : 69 : 16 : 구문 오류 삽입 "; " 오류가 말한대로 문을

을 완료하려면 다음 줄에 문을 완료 ;를 삽입해야합니다

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

을 따라서, 너무 :

<id><%link = "good_subjectdoc_relativeurl.xml";%></id> 
+0

나는 ";" "<% link ="good_subjectdoc_relativeurl.xml "%>"로 변환되는> "<% link = baseURL +"/ "+ Integer.toString (++ id); %><%=link%>" ";" 몇 가지 이유. – user994165

+0

실행중인 코드를 실행하고 있습니까? 재 구축/재배포/재시작. – BalusC

+0

예 방금 재배포했습니다. 로그에서 나는 등호에서 시작하여 점 다음에 'x'로 끝나는 화살표를 사용합니다.^------------------------- -----^ – user994165