I am working in Spring Framework MVC application with WebLogic server. I am using jstl 1.2. and I have a custom taglib created by me.
I have created the below Tag:
public class DisplayImageTag extends SimpleTagSupport {
private Collection<Image> images;
private Byte[] logo;
private String action;
@Override
public void doTag() throws JspException, IOException {
PageContext pc = (PageContext)getJspContext();
JspWriter out = getJspContext().getOut();
pc.getRequest().setAttribute("test", "test");
String fullPath = TDKUtils.getTDKPath(pc);
sb.append("<img src='" + fullPath + "/displayImage?resize=true' align='bottom' />");
out.print(sb);
}
}
I have defined this servlet, but the value of request.getAttribute("test") is null
! ?
public class DisplayImageServlet extends HttpServlet {
@SuppressWarnings("unchecked")
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
System.out.println ("test ---> " + request.getAttribute("test"));
..
}
and the JSP
<tdk:displayImage logo="${logo}" width="200" />