Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

struts 2 tags question, certain jsp code not being executed

Posts: 1
  • Mark post as helpful
  • send pies
  • 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>
<div align="top" style="width: 300px;border-style: solid; background-color: #F5FFFA">
<s:div id="chart1" theme="ajax" href="%{stockQuoteCharter}" loadingText="Loading..." listenTopics="/refresh10"/>

<s:url id="stockQuoteInitChart" action="stockQuote">
<s:param name="sTicker"><s:property value="sTicker" /></s:param>
<s:param name="category">SP500</s:param>
<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>

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!
Posts: 67424
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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.
    Bookmark Topic Watch Topic
  • New Topic