
Trying to write the function as below but getting errors. Can you please identify the cause of error and how to correct it.
<% public String retrieveAndClearErrorMessage(HttpSession session) { String errorMessage = (String)session.getAttribute("errorMessage"); if(errorMessage == null) { errorMessage = ""; } session.removeAttribute("errorMessage"); return errorMessage; }
%>
Error: (error after "retrieveAndClearErrorMessage". It does not like the parameter.) Multiple annotations found at this line: - Syntax error on token ")", ; expected - Syntax error on token "(", ; expected

Got it , had to use <% ! %>
instead of <% %>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.