Insert the following code in your jsp. Automatically the dynamic content will be converted to excel .
<%@ page contentType = "application/vnd.ms-excel" %>
<% response.setContentType("application/vnd.ms-excel"); %>
<%@ page contentType = "application/vnd.ms-excel" %>
<% response.setContentType("application/vnd.ms-excel"); %>