• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

VariableDeclaratorId expected

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
in the process of reading this article: Character Conversions from Browser to Database, i used this jsp directive as in the article:
but i get an error message, saying:
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 1 in the jsp file: /jsp/sayhello.jsp
Syntax error on token "pageEncoding", VariableDeclaratorId expected after this token
1: <% @page pageEncoding="ISO-8859-1" contentType="text/html; charset=ISO-8859-1" %>

as i dont know how to sort this out, here i am asking for help

(as a curiosity, if i comment that line out, i can run the code without any problem)

thanks in advance
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please take the time to choose an appropriate forum for your posts. This forum is for questions on HTML and JavaScript. For more information, please click this link ⇒ CarefullyChooseOneForum.

This post has been moved to a more appropriate forum.

you'r right: i was induced in error because of the nature of the article i point to, as it deals with encoding and so its html related, i guess
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. Nothing at all to do with HTML. That's an error with the JSP translator.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote: That's an error with the JSP translator.

so, if it is a jsp translator error, how can one fix it?
is there another way of implementing that jsp directive?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I don't know what it's complaining about. I have rarely used the page directive as the defaults are almost always sufficient.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, thank you
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i eliminate the space right before the @, i get no complaints at all:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ha! Yeah, I missed that. The error message (rather poor, if you ask me) directed attention to the attributes. I missed the erroneous space. Doh!

Similarly you can't put a space in scriptlets like <% = and <% !. But then again, one shouldn't be using scriptlets at all anymore.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic