English 中文(简体)
哪一个范围(申请、保全案文、httpSession)将EL用于解释属性
原标题:which scope (application, servletContext, httpSession) will EL use for interpreting attributes

当我使用<代码><c:out Value=“${}”> in a jsp时,Site应当位于何处(服务器,http:Session and request)?

我试图让一位控制员在http://Session上设定属性(/ Line,但随后将${}。 不要给我任何东西。 而另一方面,如果我把它列入“保全案文”,${}。 给我以价值。 这似乎并不正确。 您能否在jsp(使用jstl)与控制器(java)之间传递特征? 提前感谢。

最佳回答

将在座标下使用JspContext#findAttribute()<>a>。 相关的javadoc提到:

搜索页、要求、会议(如有效)和申请范围(s),并将相关价值或无效。

因此,它将归还在按页、要求、会议和应用范围(保全案文)搜索后发现的第一个非致命价值。

如果您在多个领域拥有相同名称的属性,并且(或)希望从具体范围获得属性,那么,您可以通过<代码>--pageScope}、_${requestScope}${sessionScope}和/或>>_{applicationScope}提供的属性地图查阅。 E.g.

${requestScope.track}

See also:


回到你的实际问题:如果你在获得届会的属性方面存在问题,那么这只能意味着联合人民党没有使用与保留者相同的届会。 您可以通过在服务器中印刷《会议设计书》来加以压缩。

System.out.println(session.getId());

和共同财产

${pageContext.session.id}

两者都应照相。 否则,它肯定不会分享同一届会议。 本届会议是域名、背景和依赖方。

您可以通过仅印刷<>${sessionScope}的方式展示所有可用的会议属性。 它将以Abstract#MaptoString(,其中包含所有会议属性。

${sessionScope}
问题回答

暂无回答




相关问题
Convert typed-in Text to lowercase

I ve got an index.jsp with [snip] <% String name = request.getParameter("name"); String pass = request.getParameter("pass"); String globalname = "webeng"; String globalpass = "2009"; ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

Setting the default value in Struts2

I am setting the value(kind of default value) for a drop down select value from action class in a page(given below). When the page loads the value is beig displayed but the other elements of the ...

Evaluate dynamically constructed JSP at runtime

I have a requirement where in the JSP page itself is created by the user and stored in the database. When viewing results we need to render this JSP to the client, evaluating all tags inside this JSP. ...

How to Pack/Encrypt/Unpack/Decrypt a bunch of files in Java?

I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

ArrayList to Table in JSP

I have an ArrayList and i am trying to display it in a table ..... ArrayList rows = .... ..... <table cellspacing="1" cellpadding="4" border="3"> <tr> <TH>...

热门标签