Posted by JSP | Posted on 09-12-2008
| Posted in
Cannot find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”
‘Cannot find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”‘ is an error message that you might have seen while executing your JSTL code. So if you are getting this error message, the first thing you need to do is to make sure that you have all the JSTL jar files are in your class path. If you have the JSTL libraries in your class path and still you are getting the same error, you will have an older version of JSTL in your class path. Now to fix this issue change the declaration to
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
Posted by JSP | Posted on 22-05-2008
| Posted in
Last day I was taking an interview in my company. The interview was for WebSphere Commerce. So I thought of going directly to WCS questions. But that guy said that he was working on WCS long back and he forgot everything in WebSphere Commerce. Then I thought I will ask some JSP questions as he was mentioned JSP in each and every project in his resume.
I thought of starting with a usual JSP interview question. So I asked him what is the difference between static include and dynamic include in JSP. His answer was partially correct. So I though I will write a post on what are the differences between static include and dynamic include in JSP. So the difference between static include and dynamic include are
- The syntax for static include is <%@ include file=”filename.jsp” %> and the syntax for dynamic include is <jsp:include page=”filename.jsp” />
- Static include is an inline inclusion. i.e., the contents of the file will be included at translation phase. It’s something like a copy and paste . In case of dynamic include the response of the file will be included to the original response at runtime. The file will be processed separately and only the response will become the part of the original files’ response.
- Static include cannot have a dynamic filename. This is because the servlet container needs the files for inclusion, at translation phase itself. But dynamic include can have a dynamic filename. Here the file is getting included at runtime.
- Static include cannot accept a parameter (What this parameter will do even if are passing it?). But dynamic include can accept a parameter. (Here we have some one to do something on the parameter).
- Static includes are faster than dynamic includes.
I believe these are the differences between static include and dynamic include. I think I have covered all. If I missed anyone, please let me know.