jsp - How to make EL not to print evaluated expression? -
i want rid of taglib declarations in every jsp page (similar question).
that's why made headr.jsp html header stuff , taglib declarations. want include in every jsp page this:
<%@ include file="/web-inf/include/header.jsp" %>
whose content start with:
<%@ page pageencoding="utf-8" contenttype="text/html; charset=utf-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <!doctype html> ... <title>${pagescope.pagetitle}</title>
the problem have page title in header.jsp, want change. need set in jsp page before including header.jsp, can not use c:set
, because jstl not declared yet. decided use el put pagetitle in param or somescope map this:
${param.put("pagetitle", "test")}
now problem npe here. sure caused put()
returning null when add new entry map, , el tries print null output.
ps: know can use scriptlets, since bad practice, not consider them @ , disabled them in web.xml.
Comments
Post a Comment