How do I mix JSP and SSI #include?

If you're just including raw HTML, use the #include directive as usual inside your .jsp file.<!--#include file="data.inc"-->But it's a little trickier if you want the server to evaluate any JSP code that's inside the included file. If your data.inc file contains jsp code you will have to use <%@ vinclude="data.inc" %> The <!--#include file="data.inc"--> is used for including non-JSP files.

Showing Answers 1 - 1 of 1 Answers

rajni

  • Oct 14th, 2005
 

As in answer, it was written that i have use <%@ vinclude="data.inc" %> for file having jsp code but in my application i have used the code like that <%@ include file="user_information.inc" %> and  user_information.inc file contains the following code :

   <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
     <td width="50%" align="left" class="H4" >&nbsp;<b><%= objUtil.getUserName( (HashMap)session.getAttribute(Constants.OBJECT_USER) )%></b></td>
     <td width="50%" align="right" valign="bottom">
      <table width="530" cellpadding="0" cellspacing="0" border="0">
       <tr>
        <td width="200" align="right" class="blacklabel"><%=objUtil.getCurrentDate() %></td>
        <td width="110" align="right"><a href="javascript:history.back()"><font class="darklabel"><b>Go Back</b></font></a>&nbsp;&nbsp;</td>
        <td width="110" align="right"><a href="TrackerController?Action=LogoutUser"><font class="blacklabel">LOG OUT</font></a>&nbsp;&nbsp;</td>
       </tr>
      </table>
     </td>
    </tr>
   </table>

and that is working fine . can u explain this ??????

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions