This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

VariableDeclaratorId expected

 
Ranch Hand
Posts: 1282
  • 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: 1282
  • 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
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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: 1282
  • 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
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, thank you
 
miguel lisboa
Ranch Hand
Posts: 1282
  • 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
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!