How to output HTML from JSP <%! … %> block?

前端 未结 8 871
温柔的废话
温柔的废话 2020-12-01 10:25

I just started learning JSP technology, and came across a wall.

How do you output HTML from a method in <%! ... %> JSP declaration block?

This do

8条回答
  •  被撕碎了的回忆
    2020-12-01 10:56

    too late to answer it but this help others

    <%! 
         public void printChild(Categories cat, HttpServletResponse res ){
           try{
              if(cat.getCategoriesSet().size() >0){
                  res.getWriter().write("") ; 
              }
           }catch(Exception exp){
    
           }
         }
    
    %>
    

提交回复
热议问题