jsp service bean
//在jsp中使用后台service中方法需要在jsp页面引入service bean
1 <%@page import="com..entity.Users"%>
<%@page import="com.service.UsersService"%>
<%@page import="com.service.UserAmountLogService"%>
<%@page import="com.entity.UserAmountLog"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<jsp:useBean id="userAmountLogService" class="com.service.impl.UserAmountLogServiceImpl"/>
<jsp:useBean id="usersService" class="com.service.impl.UsersServiceImpl"/>
<%
ApplicationContext context =WebApplicationContextUtils. getWebApplicationContext(application);
UserAmountLogService amountLogService =(UserAmountLogService)context.getBean("userAmountLogService");
UsersService userService=(UsersService)context.getBean("usersService");
%>
jsp service bean的更多相关文章
- Spring MVC不要在@Service bean中保存状态
先看这么一段代码: @Service public class AccountService { private String message; public void foo1() { if (tr ...
- 非Controller类无法使用Service bean解决方案
尝试方案: 1 在Spring的配置文件springmvc.xml中,增加扫描项base-package="zxs.ssm.util",增加你需要使用service的类所在的包 ...
- 学生管理系统开发代码分析笔记:jsp+java bean+servlet技术
1 序言 学习java web的时候很渴望有一份完整的项目给我阅读,而网上的大部分项目拿过来都无法直接用,好不容易找到了一个学生管理系统也是漏洞百出.在此,我将边修改边学习这份代码,并且加上完全的注释 ...
- Java后台代码调用Spring的@Service Bean的方式
比如:在我的project中有一个类CompassIndexOperation,以: @Service("CompassIndexOperation") @Transactiona ...
- spring springboot websocket 不能注入( @Autowired ) service bean 报 null 错误
spring 或 springboot 的 websocket 里面使用 @Autowired 注入 service 或 bean 时,报空指针异常,service 为 null(并不是不能被注入). ...
- 过滤器手动注入Service Bean方法
@Override public void init(FilterConfig arg0) throws ServletException { ServletContext servletContex ...
- JSP之Bean
<jsp:useBean id=" " class" "/>创建JavaBean对象,并把创建的对象保存到域对象 比如:<jsp:useBea ...
- 在filter中使用spring的service bean
http://blog.csdn.net/godha/article/details/13025099
- (原创)ssm sql 例子(freemarker+jsp)
ssm整合地址:http://www.cnblogs.com/xiaohuihui96/p/6104351.html 接下讲解一个插入语句的流程和顺带讲解freemarker+jsp视图的整合 初次接 ...
随机推荐
- 前端学习(二十九)nodejs(笔记)
后台语言 java php .Net python Node.js------------------------------------------------- ...
- 【串线篇】mybatis-config.xml配置事项
一.术语 properties 属性 settings 设置 typeAliases 类型命名 typeHandlers 类型处理器 objectFactory 对象工厂, plugins 插件, e ...
- Repeater的使用
1.页面代码 如果要分页,那么页面开头必须写(<%@ Register Src="~/Controls/Page.ascx" TagName="Page" ...
- Django 与 Flask框架的比较
Django Django恐怕是最有代表性的Python框架了.它是一个遵循MMVC架构模式的开源框架.它的名字来自Django Reinhardt,一个法国作曲家和吉他演奏家,很多人认为他是历史上最 ...
- yum工具入门
一yum介绍 注意学完了yum之后,rpm的使用频率就少了.有些功能yum用起来不如rpm更方便. CentOS: yum, dnfYUM: Yellowdog Update Modifier,rpm ...
- 因为看见,所以发现:QBotVariant谢绝落幕
互联网给人带来便捷的同时,其公开大量的资源也同样给恶意利用者带了便捷,越来越多公开的恶意程序源码降低了对外攻击.入侵的难度,使得安全问题愈加严重. 阿里云安全团队从今年5月份监测到一BOT家族,其样本 ...
- boot、cloud
最近在学习Spring Boot也整理了一些文章,有需要的可以参考一下 https://www.zhihu.com/question/39483566 Spring Cloud是一系列框架的有序集合. ...
- 深入研究CSS
通常我们在学习CSS的时候,感觉很容易掌握,却常常在实际应用中碰到各式各样难以填补的“坑”,为避免大家受到同样的困惑与不解,本文详细讲解了CSS中优先级和Stacking Context等诸多高级特性 ...
- MacBook Pro 快捷键2
Mac 键盘快捷键 您可以按下组合键来实现通常需要鼠标.触控板或其他输入设备才能完成的操作. 要使用键盘快捷键,请按住一个或多个修饰键,同时按快捷键的最后一个键.例如,要使用快捷键 Command ...
- 96、搬家到csdn
大家好: 今天开始会将所有的博客搬家到CSDN,以后请参考CSDN上的博客:http://blog.csdn.net/u012416045 谢谢 维真