JSP access to beans in spring
<%@page Import="com.sai.comment.po.TSdComment"%><%@page Import="Com.sai.comment.service.CommentService"%><%@page ContentType="text/html"pageencoding="UTF-8"%><%@page Import="java.util.List"%><%@page Import="org.springframework.web.context.support.*"%><%@page Import="org.springframework.context.*"%><%@page Import="java.util.List"%><%@page Import="org.springframework.web.context.support.*"%><%@page Import="org.springframework.context.*"%><%@page Import="com.sai.comment.*"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Lnua Platform Spy page</title></Head><Body> <%!PrivateCommentservice Commentservice; @Override Publicvoid init () {ApplicationContext CTX=webapplicationcontextutils. Getwebapplicationcontext (Getservletcontext ()); Commentservice=(Commentservice) Ctx.getbean ("Commentserviceimpl"); }%> <%try {StringCommentid=Request.getparameter ("Commentid"); Tsdcomment Comment=Commentservice.findbyid (Commentid); Out.println (Comment.getuser (). GetUserName ()); Out.println (Comment.getcreatetime ()); Out.println (Comment.getcommentcontext ()); Out.println (Comment.getcommentid ()); } catch (Exception e) {e.printstacktrace (); Out.print ("System Busy"); } %></Body></HTML>
JSP access to beans in spring