• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts 2 tags question, certain jsp code not being executed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic