my dog learned polymorphism*
The moose likes JSP and the fly likes <%@ include file= in jsp" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "<%@ include file="invoiceFtpPush.xhtml" %> in jsp" Watch "<%@ include file="invoiceFtpPush.xhtml" %> in jsp" New topic
Author

<%@ include file="invoiceFtpPush.xhtml" %> in jsp

Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi All,

I want to include my xhtml page into my jsp page like :




I want to know is it possible or not? if not possible then any alternative or if possible then how can i do it?

Right now it is not working.

Any idea will be appreciated.

Thanks and Regards,
Khushwinder


Khushwinder
ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Hi,

To include an HTML or JSP fragment in a JSP file, the include directive is used. The effect is essentially equivalent to replacing the directive with the contents of the included file. This means that an included fragment can access any objects defined in the main JSP page.
The include file specified by include directive is always relative to the file containing the include directive. For example, if a file A.jsp includes dir/B.jsp which in turn includes C.jsp, C.jsp is assumed to be in the directory dir.

This example includes a file called relativeFragment.jsp which is located in the same directory as the current file:



This example includes a file called /absoluteFragment.jsp which is located relative to the web application's root:


At the time the main JSP page is accessed, the include directive permanently captures the current contents of an included file. Changes to the included file will not affect the results of the main JSP page. If the application depends on capturing the contents of the included file at the time of each request, then an include action should be used.
These examples demonstrate how to use an include action to dynamically include the contents of a relative or absolute fragment at every request:



It is also possible to dynamically choose the file to include. This example determines the file to include from a request parameter:



Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
 
Don't get me started about those stupid light bulbs.
 
subject: <%@ include file="invoiceFtpPush.xhtml" %> in jsp
 
Similar Threads
can i include portion of jsp using include tag
Regarding Include directive element
import inside a getter/setter
include file without server side technology?
jsp:include resource not found