• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting error Syntax error on token "import", delete this token on compilation of the JSP page

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
My JSP page looks like


On trying to compile JSP page I get the following error
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 10 in the generated java file
Syntax error on token "import", delete this token

I have seen a similar thread. but i fail to understand the resolution. Also I know it is a bad idea to have Java code in you JSP page but for now could anyone help me resolve this error.

Regards,
Rachael

 
Sheriff
Posts: 67746
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
Why do you have obsolete Java code in your JSP? This technique has been obsolete since 2001!

Using the JSTL and EL rather than Java cod win JSPs prevents syntax errors in the first place.

See this JspFaq entry
 
Bear Bibeault
Sheriff
Posts: 67746
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
Also, please be sure to UseCodeTags. I added them for you in your post.

One thought: make sure that the quote characters are plain, vanilla quotes, and not word-processor fancy quotes.
 
Rachael Rose
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bear Bibeault,
Thaks you for a quick response.I quiet agree with you. But I am trying this just to make it work once. It is just a proof of concept using mule ESB. This client side code will be moved to the server side once I finish the POC. But for now all i want is to resolve this error.

Regards,
Rachael
 
Ranch Hand
Posts: 355
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi Rachael,
If you look at your import well, it is not well framed. Please, you may make it look like

 
Rachael Rose
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul,
I should surely invest on a pair of good spectacles :) :D

Thanks a lot
Regards,
Rachael
 
reply
    Bookmark Topic Watch Topic
  • New Topic