java - What is the difference between <% ... %> and <%! ... %> in jsp -
i adding more functionality page has 2 tags mentioned in title. noticed variable declare in <% ... %> cannot used in <%! ... %> , vice versa. difference between 2 , how can declare variables used in 2 tags
<% ... %> used embed java code within main service() method of jsp. executed during rendering of page.
<%! ... %> used define code outside of flow of page, , therefore outside main service() method. typically, used define utility methods called within <% ... %> block.
both approaches obsolete, however. jsp el, jstl , tag classes preferred way of doing same thing.
Comments
Post a Comment