• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

VariableDeclaratorId expected

 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, thank you
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if i eliminate the space right before the @, i get no complaints at all:
 
Bear Bibeault
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic