2014年5月22日星期四

How to call methods SSH service layer in a JSP page

code is as follows :
<%
com.yun.gover.service.SiteBaseService siteBaseService = null;
com.yun.gover.model.collection.SiteBaseCollection SiteBaseColl = siteBaseService.GetListPagerBy ("SITE_ID", 1,10);
%>
The second Health reported java.lang.NullPointerException.
emergency, help ! ! ! !
------ Solution ---------------------------------------- ----
can not be directly transferred to a class that implements the interface . It is through injection .
------ For reference only -------------------------------------- -
method since you use the SSH service layer, why are you even call in jsp it ! Obtained directly in the action , using the label displayed in jsp not on the line
------ For reference only ----------------------- ----------------
it too obvious. siteBaseService object or null, the object method call siteBaseService certainly a null pointer .
------ For reference only -------------------------------------- -
call service method in action can be
------ For reference only ------------------------ ---------------
how we can call that method in JSP Yeah
------ For reference only ---------- -----------------------------
using delimiter :
<%!
IService ser;
/ / public void SetSer (IService ser);
%>
<%
ser.method () ;/ / method call service for
%>
can .
------ For reference only ------------------------------- --------
why should it , action layer with a block of code to get the data directly in the page tag on the line ah, you do look very troublesome, very slow page loads
------ For reference only ---------------------------------------
com.yun.gover.service.SiteBaseService siteBaseService = null;
It's not quite clear what the assignment of empty space that is not what
------ For reference only ------------- put in the request , get that in <% java code after --------------------------
can get the service in action You can use %>

没有评论:

发表评论