This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes struts 2 tags question, certain jsp code not being executed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 tags question, certain jsp code not being executed" Watch "struts 2 tags question, certain jsp code not being executed" New topic
Author

struts 2 tags question, certain jsp code not being executed

Ghazy Mahjub
Greenhorn

Joined: Apr 05, 2009
Posts: 1
I have the following code in my jsp...

<s:url action="stockQuote" id="stockQuoteCharter">
<s:param name="sTicker"><s:property value="sTicker" /></s:param>
<s:param name="category"><s:property value="category" /></s:param>
</s:url>
<div align="top" style="width: 300px;border-style: solid; background-color: #F5FFFA">
<s:div id="chart1" theme="ajax" href="%{stockQuoteCharter}" loadingText="Loading..." listenTopics="/refresh10"/>
</div>



<s:url id="stockQuoteInitChart" action="stockQuote">
<s:param name="sTicker"><s:property value="sTicker" /></s:param>
<s:param name="category">SP500</s:param>
</s:url>
<s:a theme="ajax" href="%{stockQuoteInitChart}" executeScripts="true" targets="chart1"><b><font size="2.0" color="blue"><s:property value="sTicker" /></font></b></s:a>
</td>

As you can see, pressing on a link here should executed the action stockQuote and then display the result in the target div id="chart1". Well, everything is fine except that it does not display the result in the target div, it simply takes me to a new page and displays the result jsp on a new page. Why??? I don't know. In addition, when this page gets loaded, it should load the contents of the div, but it is simply empty. This is getting really frustrating so please any help is much appreciated. Thank you!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61306
    
  66

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Have you included the <s:head> tag with the "ajax" theme? This is required to load the Dojo scripts. Also, you may need to use OGNL's "#" character when referencing the URL created with the <s:url> tag in the <s:a> tag's "href" attribute.
 
GeeCON Prague 2014
 
subject: struts 2 tags question, certain jsp code not being executed