• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Rachael Rose
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Paul Ngom
Ranch Hand
Posts: 355
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Paul,
I should surely invest on a pair of good spectacles :) :D

Thanks a lot
Regards,
Rachael
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!