In JSP file of JBoss and Tomcat, specific variables can not be declared such as org with <jsp:include> tag.

Solution Verified - Updated -

Issue

Coding JSP on EAP5.1.2

variable name is org, when <jsp:include .. is involved, an error message "org.apache cannot be resolved" was throwed out.

17:11:41,794 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 6 in the jsp file: /test.jsp
org.apache cannot be resolved or is not a field
3:  String org="222";
4:  out.println(org);
5: %>
6: <jsp:include page="inc1.jsp"/>

Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)

Environment

JBoss Enterprise Application Platform 5.1.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content