Clean up for html/jsp and optimize AppPage.java #2099

for #2099