开发者

How to do this JSP code <%= session.getAttribute("attributeName") %> in Expression Language

开发者 https://www.devze.com 2023-04-05 14:35 出处:网络
How to do this JSP code <%= session.getAttribute(\"attributeName\") %> in Expression Language where stuff goes like ${blabla}

How to do this JSP code <%= session.getAttribute("attributeName") %> in Expression Language where stuff goes like ${blabla}

Forgot to say that I actually tried the ${sessionScope.attributeName}, btw the attribute value is a String and was set by session.setAttribute("attributeName", "EditSession123"); and to check on that the value was sent right I created a jsp 1.0 file and used <%= session.getAttribute("attributeName") %> which was working but when I used JSP 2.0 nothing appears.

I'm beginning to question my header definitions ? it's auto generated from Eclipse

<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"开发者_JS百科 version="2.0">
    <jsp:directive.page contentType="text/html; charset=UTF-8" 
        pageEncoding="UTF-8" session="false"/>
    <jsp:output doctype-root-element="html"
        doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
        omit-xml-declaration="true" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Insert title here</title>
</head>
<body>

hello ${sessionScope.attributeName}

${pageContext.servletContext.serverInfo}

</body>
</html>
</jsp:root> 


ops, :S session is set as false, I should have read the eclipse generated code carefully,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号