Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » String literal is not properly closed by a double-quote(<%@ include file=" myfile.jsp " %> doesn't work)
String literal is not properly closed by a double-quote [message #496503] Tue, 10 November 2009 06:16 Go to next message
Richard Newmark is currently offline Richard Newmark
Messages: 5
Registered: November 2009
Junior Member
If I copy a web project that is perfectly happy in netbeans, to eclipse galileo or eclipse ganymede, that has an include line in a .jsp file like:

<%@ include file=" myfile.jsp " %>

I get the parsing error
"String literal is not properly closed by a double-quote"

I've tried every conceivable permutation to get rid of this error, but have been unsuccessful. This is with the latest downloaded galileo, and is reproducible in tiny 2 line .jsp files.

I can't find any bug report of this problem, so is this a known problem with a known solution? Am I overlooking something?
Re: String literal is not properly closed by a double-quote [message #496532 is a reply to message #496503] Tue, 10 November 2009 08:17 Go to previous messageGo to next message
Ian Tewksbury is currently offline Ian Tewksbury
Messages: 48
Registered: July 2009
Location: RTP, NC, USA
Member
Richard,

I just tried a file with only:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file=" MyFile.jsp " %>

And saw no errors. What version of WTP are you running? To find out in Eclipse go to "Help -> About Eclipse SDK", then click on the graphic button that says "WTP". There will then be a Version number listed at the bottom of the dialog window.

Also if you have not tried it yet close the file in question then select "Project -> Clean" and be sure "Clean all projects" is selected, press OK. Open the file again and see if your error is still there.

~Ian


Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
Re: String literal is not properly closed by a double-quote [message #496548 is a reply to message #496503] Tue, 10 November 2009 08:55 Go to previous messageGo to next message
Mauro Molinari is currently offline Mauro Molinari
Messages: 277
Registered: July 2009
Senior Member
Richard Newmark ha scritto:
> <%@ include file=" myfile.jsp " %>
>
> I get the parsing error "String literal is not properly closed by a
> double-quote"

Maybe the error is in myfile.jsp, but it is reported also in the JSP
where you are including it?

Mauro.
Re: String literal is not properly closed by a double-quote [message #496554 is a reply to message #496532] Tue, 10 November 2009 09:17 Go to previous messageGo to next message
Richard Newmark is currently offline Richard Newmark
Messages: 5
Registered: November 2009
Junior Member
Hi Ian, Thanks for taking a look.

I'm using
Version: 3.1.1.v200908120400-7R77FSpEVw2xXR0CtKvX6bG6a2qU

If I cut and paste your example piece of code, I too, now get no errors (although I was earlier).

I regularly clean the project, whenever something funny like this happens, and/or restart Eclipse

Something odd is going on. My main project, copied from Netbeans is still riddled with these errors. I'll have to start building the files up from scratch to try & isolate what is causing it.



Re: String literal is not properly closed by a double-quote [message #496556 is a reply to message #496548] Tue, 10 November 2009 09:20 Go to previous messageGo to next message
Ian Tewksbury is currently offline Ian Tewksbury
Messages: 48
Registered: July 2009
Location: RTP, NC, USA
Member
Mauro Molinari wrote on Tue, 10 November 2009 08:55
Maybe the error is in myfile.jsp, but it is reported also in the JSP
where you are including it?

Agreed. I am able to reproduce what Richard is seeing by doing the following:

Test.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file=" MyFile.jsp " %>

MyFile.jsp:
<% 
String s = ";
%>

In this case the error is reported on the "; in the MyFile.jsp and then the validation error is carried over to the Test.jsp and reported on the imported file.

Richard, check your imported file and see if you can find the error in there.

~Ian


Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
Re: String literal is not properly closed by a double-quote [message #496596 is a reply to message #496503] Tue, 10 November 2009 11:28 Go to previous messageGo to next message
David M. Karr is currently offline David M. Karr
Messages: 350
Registered: July 2009
Senior Member
(Response removed.)

[Updated on: Tue, 10 November 2009 11:29]

Report message to a moderator

Re: String literal is not properly closed by a double-quote [message #496762 is a reply to message #496503] Wed, 11 November 2009 05:30 Go to previous messageGo to next message
Richard Newmark is currently offline Richard Newmark
Messages: 5
Registered: November 2009
Junior Member
Hello again.
Well, you're right in saying that it is the included file that is the problem... but ....

If the main file is:
//////////////////////////////////////////////////////////// /////
<%@ page pageEncoding="ISO-8859-15"
contentType="text/html; charset=UTF-8" language="java"
import="java.net.*, java.util.zip.*,
java.lang.Object.*, java.io.*,java.sql.*,java.util.*, java.text.* " %>

<%@ include file="connections.jsp " %>

//////////////////////////////////////////////////////////// //////////
and the included file (connections.jsp) is:

<%!
public void makeXMLSafeString(String aTagFragment)
{
StringBuffer result = new StringBuffer();
result.append("&quot;");

}
%>
//////////////////////////////////////////////////////////// /////

the observed problem can be reproduced. Commenting out the result.append("&quot;"); corrects the problem (after cleaning/saving the file)

Re: String literal is not properly closed by a double-quote [message #496826 is a reply to message #496762] Wed, 11 November 2009 09:02 Go to previous messageGo to next message
Ian Tewksbury is currently offline Ian Tewksbury
Messages: 48
Registered: July 2009
Location: RTP, NC, USA
Member
Richard,

There appears to actually be a bug here. It definitely has something to do with the &quot;

For the included file I also tried:
<%!
public void makeXMLSafeString(String aTagFragment) {
StringBuffer result = new StringBuffer();
result.append("&quot;&quot;");
}
%>

and the error message was: Syntax error on token """", delete this token

This tells me there is something going wrong with the translation. Could you please open a bug on WTP Source Editor. Please mention this thread along with your summery of the problem.


Ian Tewksbury
WTP JavaScript Tools
IBM Rational
-----
“When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return.” ~Leonardo da Vinci
Re: String literal is not properly closed by a double-quote [message #496898 is a reply to message #496826] Wed, 11 November 2009 11:43 Go to previous message
Nick Sandonato is currently offline Nick Sandonato
Messages: 125
Registered: July 2009
Senior Member
Just for tracking, there is a bug out there already for this [1]. It's already been released for 3.2.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=287971
Previous Topic:WTP and SOAP Attachments
Next Topic:Hyperlink to (Cross file) XML node
Goto Forum:
  


Current Time: Thu Jul 24 11:24:31 EDT 2014

Powered by FUDForum. Page generated in 0.03439 seconds