<jsp:include page="url" flush="true">
应该只能用相对url吧
就是说你应该把jsp container和IIS整合在一起

解决方案 »

  1.   

    <jsp:include>就是包含页面的输出,http://202.118.45.92/sendsms.asp解析是由202.118.45.92服务器来处理。
      

  2.   

    晕!你看明白这篇文章说的意思了吗?谁告诉你可以执行ASP了?
      

  3.   

    似乎<jsp:include>只能是包含相对路径
      

  4.   

    但我202.118.45.92这台机器上有IIS呀,我只要sendsms.asp在本机执行就行了,只要把输出的静态结果给我的JSP来包含就行了,不是这个意思吗?如果不是请明示,感激不尽
      

  5.   

    你说的官方网站就是onjava.com?Java的官方网站是这个?
    他这段文字说的意思是你用<%@include file="filename"%>只能是include一个文件,这个文件必须是静态的,例如html或txt;如果你使用<jsp:include page="./news.jsp" flush="true" />他include的是一个URL,也就是说是JSP或ASP执行的结果(其实也是一些HTML),只不过它是在JSP执行的时候才include,而前种方法是编译的时候就include的了,而且不能变了。
      

  6.   

    <jsp:include>
    Includes a static file or the result from another web component. JSP Syntax
    <jsp:include page="{relativeURL | <%= expression %>}" 
       flush="true| false" />or <jsp:include page="{relativeURL | <%= expression %>}" 
       flush="true| false" >
       <jsp:param name="parameterName"
          value="{parameterValue | <%= expression %>}" />+
    </jsp:include>
    看到了吗?
    page="{relativeURL 
    整合你的IIS和jsp服务器到同一个ip:port吧
      

  7.   

    请你首先测试这个页面能否访问:
    http://202.118.45.92/sendsms.asp
    成功后才包涵到jsp里面
      

  8.   

    我测试过了,ASP的程序可以执行,但包含之后既不报错,也没有执行ASP程序的功能
      

  9.   

    看看http://java.sun.com上是怎么讲的吧:
    The <jsp:include> element allows you to include either a static or dynamic resource in a JSP page. The results of including static and dynamic resources are quite different. If the resource is static, its content is included in the calling JSP page. If the resource is dynamic, it acts on a request and sends back a result that is included in the JSP page. When the include action is finished, the JSP container continues processing the remainder of the JSP page.
      

  10.   

    经过测试,我发现,<jsp:include>在同一个Web服务器下可以返回include的页面的内容,如果是外部的就不行了。所以,如果你想运行ASP,并由<jsp:include>传递参数,那么只能将JSP服务器和IIS整合在一起了,而且可能要公用同一个目录和端口才可以。
      

  11.   

    我不知道要用什么去实现,但我可以从代码角度,结合tomcat说一下他的实现方式,我是边跟踪边写的,结构组织不是很好。
    (注:-->表示调用)
    <jsp:include>-->JspRuntimeLibrary.include(request, response, url)--> 
    RequestDispatcher rd = request.getRequestDispatcher(resourcePath);
    rd.include(request, new ServletResponseWrapperInclude(response, out));
    request.getRequestDispathcher()返回的RequestDispatcher是来自ApplicationDispatcher的一个实例.注意到没有,实际上,include最终执行的是RequestDispatcher。
    在tomcat中RequestDispathcher调用ApplicationDispatcher和include,好,重头戏到了这个,那么我们来看看ApplicationDispatcher是怎么执行的
    include-->doinclude-->invoke-->
    String jspFile = wrapper.getJspFile();
    if(jspFile != null)
        request.setAttribute("org.apache.catalina.jsp_file", jspFile);
    else
        request.removeAttribute("org.apache.catalina.jsp_file");
    servlet.service(request, response);
    最终还是对当前的web服务器提交了一个service请求,从上面可以看出用tomcat是实现不了的,如果你的web服务器在内部支持对asp的解析,那么servlet.service方法就可以成功执行,这样的话可以达到你的目标。
    当然,不同的web服务器其具体的实现方式不同,但一般大同小异。
    你所要求的目标从原理上讲可以,但现行的web服务器有没有支持的我就不清楚了。