JavaScud | Forum | JIRA | Blog |
  Dashboard > DWR中文文档 > Home > Reading from other URLs
  DWR中文文档 Log In View a printable version of the current page.  
  Reading from other URLs
Added by 黑灵, last edited by 黑灵 on Oct 29, 2006
Labels: 
(None)

从其他的URL读取数据

如果你需要读取其他web应用程序生成的页面,并返回到Javascript中。非常简单。只要在你的Java类里面包括下面这写代码:

public String getInclude() throws ServletException, IOException
{
    return WebContextFactory.get().forwardToString("/forward.jsp");
}

很明显你应该把"/forward.jsp"替换成你要forward到的页面的URL。这个URL必须以一个斜杠开始,因为它只是调用 HttpRequest.forward()

你可以用这个方法在传递之前任何定制你的页面。

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators