struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajeshwari Godbole <rgodb...@gmail.com>
Subject Specifying a target while using the <s:a> tag
Date Fri, 16 Jan 2009 05:02:22 GMT
Hello all,

I'm trying to display the results of clicking on a link within an iframe on
the same page. I'm using the s:a tag referencing an s:url tag to create the
link (as I need to pass parameters from the previous page's forms to the
link's action). Currently, it displays the resulting page (that is a PDF
report) on a new page. How do I make it direct the result to an iframe on
the same page? Is there an equivalent of the target attribute that you get
in the HTML href tag? I've also tried embedding the entire s:url in the <a
href> tag but that does not work.

As always, any help is much appreciated. Thanks!

Here is a snippet of my code in the jsp:

<s:url id="url2" includeParams='none' action="chartView">
    <s:param name="toDate">
        <s:property value="toDate" />
    </s:param>
    <s:param name="fromDate">
        <s:property value="fromDate" />
    </s:param>
</s:url>
<ul>
    <li><s:a href="%{url2}">View Chart</s:a></li>
    <li><a
        href="<s:url id='url2' includeParams='none'
action='chartView'><s:param name='toDate'><s:property value='toDate'
/></s:param><s:param name='fromDate'><s:property value='fromDate'
/></s:param></s:url>"
        target="contentFrame">View Chart2</a></li>
</ul>

<iframe id="contentFrame" name="contentFrame" scrolling="no" align="center"
frameborder="0" width="520px"
    height="750px" style="overflow:hidden;"></iframe>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message