I am trying to pass an exception string from a java class into a taglib. I take the exception from the request and pass that into a taglib that generates a div on a page with the error text. However i am getting an error saying "e cannot be resolved" The following is my code.
<% MyException e = (MyException) request.getAttribute(MyFields.EXCEPTION);
if (e != null) {
String warningLevel = "none";
if(e.getEndUserMessage().contains("warningLevel")){
warningLevel = e.getEndUserMessage().substring(e.getEndUserMessage().indexOf("warningLevel=\"") + 14, e.getEndUserMessage().indexOf("\""));
}
%>
<e:errorcontainer warningLevel="<%=warningLevel %>">
<e:error propertyFile="${SSOFields.ERROR_PROPERTIES}"
alertProperty="<%=e.getEndUserMessage()%>"> //This line is where e cannot be resolved
</e:error>
</e:errorcontainer>
<%
}
%>
I am still learning things about jsp's, so any help would be amazing. Thank you in advance.
Maybe your error isn't about the variable 'e', but taglib 'e'? For example, you didn't declare it on top of the JSP file?