History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-17039
Type: Bug Bug
Status: Open Open
Assignee: Maxim Shafirov
Reporter: Gibson
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Scriptlets and tags don't mix

Created: 01 Feb 08 18:09   Updated: 01 Feb 08 20:03
Component/s: J2EE.JSP

Build: 7,675
Severity: Medium


 Description  « Hide
I have a small JSP that looks something like this:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
        // This method is marked as returning @Nullable
	Database db = DatabaseUtil.getDatabase (session);
%>
<c:choose>
<c:when test="<%= db == null %>">
	<h1>Oops, you lost your connection!<h1>
</c:when>
<c:otherwise>
<%
        // Do some DB work
        // Hey, we just checked that this wasn't null, how come it's now marked as maybe null?
        String test = db.getSomethingFromDB();
%>
</c:otherwise>
</c:choose>


 All   Comments   Work Log   Change History      Sort Order:
Gibson - 01 Feb 08 18:11
By the way, if there is a more modern way of doing this I'd love to hear it! I'm new at all this taglib business and we have a big library of JSP pages written by Java devs who are much more comfortable typing Java than EL code ...