The bottom line is that, no, you can't send an HTML fragment to a page that contains a JSP scriptlet and expect it to be evaluated. Such evaluation happens on the server. Please read
this article to understand how JSP works.
And, of course, you shouldn't be using scriptlets at all. They've been obsolete for 15 years.