• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using <jsp:include page='<%=request.getAttribute("variable")%>'/> in Tomcat 6.0.35

 
Samir Banerjee
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We have a jsp include tag like :



We have deployed our code to Tomcat 6.0.35 recently. This tag gives below exception :

An error occurred at line: 86 in the jsp file: /jsp/cntnt/Index.jsp
The method include(ServletRequest, ServletResponse, String, JspWriter, boolean) in the type JspRuntimeLibrary is not applicable for the arguments (HttpServletRequest, HttpServletResponse, Object, JspWriter, boolean)
84: </div>
85:
86: <jsp:include page='<%=request.getAttribute("variable")%>'/>

How can I fix this issue? Please help. Thanks in advance!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you still using scriptlets 10 years after JSP2 has been introduced?
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Why are you still using scriptlets 10 years after JSP2 has been introduced?

Sadly, I still often see Java extensively being used inside JSP pages, even on fairly new applications. Only a couple times I've worked on an app that was developed back when JSP 0.9 or 1.0 just came out, so I guess at the time using Java code inside the JSP was OK.
 
Stefan Evans
Bartender
Posts: 1782
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess would be that the OP has some of the servlet classes in their WEB-INF/lib directory.

Check the WEB-INF/lib directory and remove any of:
jsp-api.jar
servlet-api.jar

and similar classes.
These libraries are provided by your Servlet container. You should find them in the Tomcat/lib directory.
Adding them into your own application only creates errors.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic