I must be missing something that I hope someone can set me straight. The webapp I inherited uses struts2 and JSP pages, and I want to organize it using this layout manager ( http://igniteui.com/layout-manager/border-layout-markup ). There will be a menu on the left which has links that will load content into the center, while the 'main' page (header, footer, left menu) stays put which I believe fits the SPA principles. The 'content' in the middle will be JSP pages that have forms with input fields that are submitted after user actions.
What I'm not understanding is how struts actions fit into this. The app has actions that are defined in struts.xml and that works fine when that page/form is submitted. But what about when the new JSP is loaded into the content section of the main page? How or what action is associated with that loading?
Currently the main page uses an iframe for the content :
<div class="center">
<iframe id="ifrmContent" name="iframe" src="jspDefaultContent.jsp" </iframe>
</div>
and when a link is clicked in the left menu this is how I switch content :
$("#ifrmContent").attr('src','jspNewContent.jsp');
First I should ask if that is the right/best way to do this, as I've seen/heard that using iframes is not ideal.
Second, the specific problem is that there is no 'action' associated with this new JSP content page loading. So the OGNL that was used to fill in some s:select element lists with data from the database does not work. Specifically this WILL work : "%{@com.my.class@countryList}" because its calling a static variable within that Java server class, but this does NOT : "%{getCities()}" as it is looking to call a method of an action class.. and there is none. It doesn't call the MAIN page action, nor does it call the content page action class.
How can I get an action class associated to the content page I'm loading from a menu link? Or, how can/should this be organized so I don't have these problems, given that I only want to refresh/submit the content and not the entire MAIN page?
Thanks for any advice.