Hi,
If you check up on the specs, It will clarify you the usage of request time
inclusion,
@include is a translation time inclusion.
If you want to dynamically include pages use jsp:include instead
If That Helps
Amit
SYNTAX__________________________________________________________________
<%@ include file="copyright.hmtl" %>
where as
<jsp:include page="{ relativeURL | <%= expression %>}" flush="true" />
SPECIFICATION________________________________________________________
Chapter 2 Core Syntax and Semantics 56
2.12.1 Request Time Attribute Values
Action elements (both standard and custom) can define named attributes and
associated
values. Typically a JSP treats these values as fixed and immutable but the
JSP 1.1 provides a
mechanism to describe a value that is computed at request time.
An attribute value of the form "<%= scriptlet_expr %>" or '<%=
scriptlet_expr %>' denotes
a request-time attribute value. The value denoted is that of the scriptlet
expression involved.
Request-time attribute values can only be used in actions. If there are more
than one such
attribute in a tag, the expressions are evaluated left-to-right.
Only attribute values can be denoted this way (e.g. the name of the
attribute is always an
explicit name), and the expression must appear by itself (e.g. multiple
expressions, and
mixing of expressions and string constants are not permitted; instead
perform these
operations within the expression).
The resulting value of the expression depends upon the expected type of the
attribute's value.
The type of an action element indicates the valid Java type for each
attribute value; the
default is java.lang.String.
By default, all attributes have page translation-time semantics. Attempting
to specify a
scriptlet expression as a value for an attribute that has page translation
time semantics is
illegal, and will result in a fatal translation error. The type of an action
element indicates
whether a given attribute will accept request-time attribute values.
Most attributes in the actions defined in JSP 1.1 have page translation-time
semantics.
The following attributes accept request-time attribute expressions:
* The value and beanName attributes of jsp:setProperty (2.13.2).
* The page attribute of jsp:include (2.13.4).
* The page attribute of jsp:forward (2.13.5).
_________________________________________________________________________
Amit Ghaste
From: Arni Raghu[SMTP:[EMAIL PROTECTED]]
Sent: Saturday, January 15, 2000 10:15:14 AM
To: [EMAIL PROTECTED]
Subject: Re: Include files dynamically???
Auto forwarded by a Rule
see the syntax in the docs..
It is simple..
<%@ include file="myfile.jsp" %>
also remember that you cannot do this more than once..since jsp
statically
includes the jsp into the same servlet..having the same name twice
in the
same will errors like duplicated bean etc..If u prefer to just defer
the
processing to the webserver then use <%jsp:include.....%> again see
the docs
for this
hth,
Arni
----- Original Message -----
From: Niranjan Krishnamoorthy <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 14, 2000 1:36 PM
Subject: Include files dynamically???
> Hi,
>
> I would like to know whether there is any way in JSP where I can
include
> a file dynamically....
>
> I am basically trying to do this...but it doesn't work
>
> <%
> inMyFileName="someFile.jsp";
> %>
>
> <%@ include file = inMyFileName %>
>
> Am I doing something wrong? Is there any way I could do this....
> Any pointers to this willl be a great help.
>
> Thanks in advance
> Niranjan
===========================================================================
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