0

I am using Struts2-jQuery plug in to toggle between two pages with hyperlink in it...

These are the variables in .jsp page and its value from struts action...

BookList=../static/media/booklist.html
SongsList=../static/media/songlist.html

Below is the code I have written...

<s:if test="%{#BooksList!=null}">
 <div class="scrollbar scroll-indicator" style="height:324px"></div>
  <div id="bookslist">
    <sj: targets="songslist" href="%{#BooksList}" >
      Show Songs List
     </sj:>
   </div>
 <div id="songslist">
   <sj: targets="bookslist" href="%{#SongsList}" >
    Show Books List
   </sj:>
 </div>
</s:if>
<s:else>
  <div class="scrollbar scroll-indicator" style="height:324px"></div>
  <sj:div id="songlist" href="%{#SongsList}" >

  </sj:div>
</s:else>

The else part works perfectly fine. I am able to see the content of the ../static/media/songlist.html file. If condition fails it is because of the page and hyperlink I am trying to add in it...

How can I get that .html content displayed and have a hyper link below that to toggle between pages. Will provide more information if any needed. Someone please help me out. I am frozen here and not able to proceed further because of this.

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
BrinzN
  • 37
  • 1
  • 8
  • Please describe better which is the problem. Also note that the first letter of the variables in your OGNL expression should be lowercase (#books...,#songs...) – Andrea Ligios Sep 17 '15 at 07:53
  • Andrea tried that too. it does not work. – BrinzN Sep 17 '15 at 14:53
  • I have a variable in my jsp which picks the entire html path from my action class... that part works fine. the problem is when i try to get that file path to display inside a div with a link in it (to the other file) there comes the problem... If i remove the if else check and just pick the code snippet from else part and put that in a div that shows me the content in the html file... Not sure how to do a if condition check and add a link on bottom of the page to redirect it to static content from a file with again a link in it – BrinzN Sep 17 '15 at 14:54

1 Answers1

0

There seems to be a spelling difference between your struts action and html file.. 'BookList' vs 'BooksList'. Is that a typo while pasting the code here or could that be the problem?