PRJ301_-_SP_2024_-_Block_5_-_RE_1951.webp
V

PRJ301_-_SP_2024_-_Block_5_-_RE_1951.webp

(Choose 1 ans 27/50-CAP
{
Given the following JSP and tag handler code, what is the result of accessing the JSP?
JSP Page Source
<html>
<body>
<%@taglib uri="test_taglib" prefix="my Tag"%>
<% session.setAttribute("first", "first"); %>
<my Tag: TestTag/>
<br>
<%=session.getAttribute("second")%>
</body>
</html>
Tag Handler Code for <my Tag:TestTag />
package examples;
import java.io.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class TestTag extends TagSupport
{
private PageContext pageContext;
public void setPageContext(PageContext page){
this.pageContext=page;
}
public int doStartTag() throws JspException
try{String first-pageContext.getSession().getAttribute("first").toString();
nageContext.getOuto write(first):
FUO

Thông tin

Category
PRJ301
Thêm bởi
virtuous_hero
Ngày thêm
Lượt xem
4,115
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRJ301_-_SP_2024_-_Block_5_-_RE_1951.webp
File size
274.5 KB
Dimensions
1920px x 892px

Share this media

Back
Bên trên Bottom