This might be only specific to Weblogic:

In this example main.jsp has a <jsp:useBean id="mybean" class="TestBean" 
scope="page"/> tag
as well as a <%@ include file="page.jsp" %> tag.

<%@ include file="page.jsp" %> is translation time.  What it does is call the page.jsp 
at translation time to include it in the servlet that is generated from the main.jsp 
page.

page.jsp can include a reference to a bean on the main.jsp page through the scriptlet 
tags <%=mybean.method()%>
I have gotten errors when trying to use the <jsp:getProperty name="mybean" 
property="username"/> tags.

<jsp:include page="anotherpage.jsp"> or |  <jsp:include 
page="<%=jb.getRelativeURL%>"%> is request time.  It uses the
PageContext's include(StringURL, out) method.  To reference any beans declared in the 
main.jsp, anotherpage.jsp will have to reference it throught a useBean tag in 
anotherpage.jsp then you can use sciptlets or the jsp:setProperty/getProperty tags to 
set value.

Hope this helps,
Abraham


-----Original Message-----
From:   Hu, Jeffery X (Jeff) [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, September 22, 1999 9:49 AM
To:     [EMAIL PROTECTED]
Subject:        difference between "include Directive" and "jsp: include"

Hi, Java gurus:

Can anyone tell me the differences between <% @include file="pathToFile" %>
and <jsp:include page="pathtofile" />.  Giving examples will be good.

As well, I'd like to clearify some concepts - servlet and bean.  Both
servlet and bean reside in the web server.    Servlets can be directly
requested by clients(from browser) but beans can not.    Beans can be
initiated by servlets or JSP files.    The server side beans do need visual
presentations.  Correct me if I am wrong.

Thanks in advance


 << File: ATT00004.jsp >>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to