This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Using <jsp:include page='<%=request.getAttribute('/> in Tomcat 6.0.35" title="Polar Bear Day" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » JSP
Bookmark "Using <jsp:include page= Watch "Using <jsp:include page= New topic
Author

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

Samir Banerjee
Ranch Hand

Joined: Jun 21, 2010
Posts: 72
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

Joined: Jan 10, 2002
Posts: 62112
    
  68

Why are you still using scriptlets 10 years after JSP2 has been introduced?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

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

Joined: Jul 06, 2005
Posts: 1156
    
    5
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using <jsp:include page='<%=request.getAttribute("variable")%>'/> in Tomcat 6.0.35