This is my jsp code:
<%@ page language="java" %>
<% String name = (String)request.getAttribute("name1"); %>
<html>
<head>
</head>
<body>
<%=name%>
<img src=<%=name%>></img>
</body>
</html>
When I come to the jsp page by writing the following code in my servlet:
request.getRequestDispatcher("test.jsp").forward(request, response);
I see that the path of the image is correctly displayed for
<%=name>
in the body portion, but the following < img > doesn’t get executed and the image is not shown even though it exists in the displayed path.
I think it’s a problem with the
<and>inside of a HTML tag. Did you try JSP El?