JSP에서 JDK8, 톰캣 8EL 내 JSP 페이지, 나는 일식 화성을 사용하고 3.1
이됩니다 작동하지 않는 것은
<%@page import="com.cutm.pogo.User"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User Page</title>
<link href="css/nodue_style.css" rel="stylesheet" type="text/css" />
<%@ page isELIgnored="false" %>
........
<% User user = (User)session.getAttribute("LOGIN");
out.print(user.getName()); %>
${user.name }
내가 사용하고 out.print 느릅 나무는 나를 위해 일하는 것이 아니라, 엘자.
여기에 web.xml 파일을입니다
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
내가 만든 실수를 찾기 위해 도와주세요.
대신 LOGIN 속성에 액세스해야합니다. EL이 모든 범위에서 검색 할 것인지 기억할 수 없습니다. – AxelH
응답 해 주셔서 감사합니다. 코드에서 나는 $ {session.LOGIN.email}을 사용했다.이 또한 작동하지 않는다. –
'sessionScope'가 아닌'session';)이 대답들을 보라. http://stackoverflow.com/questions/8309261/how-to- get-session-attribute-a-dynamic-key-in-el – AxelH