Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IllegalArgumentException: Page directive: invalid value for import

Tags:

jsp

I'm trying to open a JSP, but I'm getting below error.

HTTP Status 500 - org.apache.jasper.JasperException: Unable to compile class for JSP

java.lang.IllegalArgumentException: Page directive: invalid value for import
    org.apache.jasper.compiler.Node$PageDirective.validateImport(Node.java:610)
    org.apache.jasper.compiler.Node$PageDirective.addImport(Node.java:591)
    org.apache.jasper.compiler.Parser.parsePageDirective(Parser.java:354)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:468)
    org.apache.jasper.compiler.Parser.parseFileDirectives(Parser.java:1787)
    org.apache.jasper.compiler.Parser.parse(Parser.java:136)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
    org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:117)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:194)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

It's referring to this line in my JSP

<%@page import="Basiccalculator.*;" %>

How is this caused and how can I solve it?

like image 375
Volkswagen Avatar asked Mar 29 '16 18:03

Volkswagen


1 Answers

Try removing the ';' from your import. I am not sure what server you are using but I found this for tomcat versions 7.057 and later. Take a look at this

like image 52
John Kane Avatar answered Sep 17 '22 12:09

John Kane