Struts2 properties in JS

101 views Asked by At

How to access S2 properties in JS. I tried the following code. Here I need to change span content dynamically in JS function.

In JS:

document.getElementById("index").innerHTML = "<s:property value='%{#request.pagination.page_records*#request.pagination.total_pages-#request.pagination.page_records*(#request.pagination.page_number-1)}'/>";

In JSP:

<span id="index"><s:property value="%{#request.pagination.page_records*#request.pagination.total_pages-#request.pagination.page_records*(#request.pagination.page_number-1)}"/></span>

But nothing is going to displays. Any other solution to this.

0

There are 0 answers