Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Including JSP files in JSP Documents  RSS feed

 
Tony romer
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP document, which starts with jsp:root.

Then I use 2 strategies,

<%@ include file="another.jsp"%>

<jsp:include page="another2.jsp">

another.jsp and another2.jsp both contain scriplets so they are not JSP documents.

in first strategy I get translation error,
in 2nd strategy I get runtime error

Am I right?
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an interesting question and I suspect that your intuition is correct. The best way to find out is to just try it in Tomcat (or your favorite web container).

I can tell you that you won't see this scenario in the SCWCD exam.

Cheers,
Bryan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!