项目中有一个要求如下:首页有一个搜索框,要求搜索返回的结果页面显示在首页中的一个框架中,如何实现这个功能???
网上有一个类似的问题:http://topic.csdn.net/u/20090930/10/9b6ba5af-5d23-4e98-bbd1-b9207b6b16f5.html
<tr>
<td colspan=2>
<s:form action='search' theme="simple" target="searchResultIframe">
<s:token></s:token>
Find<s:select list="{'any of these words', 'all of these words'}" name="searchMethod" label="Find" ></s:select>
In<s:select list="{'title', 'content'}" name="searchField" label="In" ></s:select>
<s:textfield name="searchWords" cssStyle="width:380px" ></s:textfield>
<s:submit value="Search" ></s:submit>
</s:form>
</td>
</tr>
<tr>
<td colspan="2">
<iframe id="searchResultIframe" name="searchResultIframe" width=750
frameborder="0" scrolling="no" style="padding: 0pt; overflow-y: auto;"
src="${pageContext.request.contextPath}/index/listSearchResult.jsp"> </iframe>
</td>
</tr>
可以了 在搜索提交的时候设置目标为框架名便可
比较详细的IFRAME使用说明
http://lzkyo.iteye.com/blog/446186