Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

ajax:htmlContent load baseURL by default

Luis Pedro
2011-03-25
2013-01-31
  • Luis Pedro
    Luis Pedro
    2011-03-25

    Dear all,
         I'd like to know if it is possible in ajax:htmlContent load the baseURL (or another URL) automatically. Like, for example, in

    <ajax:tabPanel   id="ajaxCurrentTab">
      <ajax:tab defaultTab="true"  baseUrl=""/>
    </ajax:tabPanel>
    

    the baseURL defined in the defaultTab is automatically loaded.

    Any idea how can I do this without using tabPanel?

    Thanks very much in advance for your time and help

     
  • If you want to include just another JSP in your project, use JSP directive

    <%@include file=""%>
    

    or

    <jsp:include page="" />
    

    . If you need other resource (possibly from another host) use JSTL tag

    <c:import url="" />
    

    .

    Or, if you want more JavaScript, remember JS object generated with ajax:htmlContent and invoke execute() manually:

    Your JSP:
    <ajax:htmlContent var="hc" ... />
    Your JavaScript:
    hc.execute();
    

    or in single JSP file:

    <ajax:htmlContent var="hc" ... />
    <script type="text/javascript">document.observe("dom:loaded",hc.execute);</script>
    
     
  • <ajax:htmlContent var="hc" ...=""/>
    <script type="text/javascript">document.observe("dom:loaded",hc.execute.bind(hc));</script>

     
  • Or maybe

    <ajax:htmlContent var="hc" ... />
    <script type="text/javascript">document.observe("dom:loaded", hc.listener);</script>