I have a simple problem in loading the contents through Ajax call in Struts 2 (using Struts2 Dojo Plugin). It is loading all the HTML contents from the page properly, but if there is any inline JavaScript function inside that page, it's not loading it all. I don't know if there are some limitations with the Struts 2 Ajax.
This my parent.jsp
:
<s:head/>
<body>
<div id="casetab2" class="casetab_content">
<sx:div href="LoadContent" delay="3000">
Initial Content
</sx:div>
</div>
</body>
This is my child.jsp
:
<s:text name="name" label="NAME"/>
<script>alert("hello")</script>
and this is my struts.xml
:
<action name="LoadContent">
<result>child.jsp</result>
</action>
result:NAME:<textfield>
is getting displayed, but the alert message is not coming.
This was a known issue...
Theoretically it should work by simply adding executeScripts="true"
to your <sx:div/>
, but if it isn't enough, try playing with the separateScripts
attribute too.