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视图的整合 初次接 ...
随机推荐
- 人生苦短_我用Python_list(列表)_002
# coding=utf-8 # 列表 list 列表函数 # 列表的特性: 可以有任何类型的值 可以更改 # 可以更改.增加.删除.修改 # 增加 append 直接在尾巴增加 list_1 = [ ...
- java基础学习笔记五(抽象类)
java基础学习总结——抽象类 抽象类介绍
- qt学习(三):鼠标图标改变
qt学习 (三):鼠标图标改变 当你进入一个美好的qt软件场景,比如游戏,电脑的黑白图标会让程序逊色不少, 1改图标要加光标的头文件, 2 载入光标图, 3 再设置改光标就可以了 1在头文件中加 #i ...
- JavaScript 六种继承方式
title: JS的六种继承方式 date: 2017-06-27 05:55:49 tags: JS categories: 学习 --- 继承是面向对象编程中又一非常重要的概念,JavaScrip ...
- Ubuntu18.04 禁用笔记本电脑键盘
1.先在命令行工具中输入 xinput list 找到AT Translated Set 2 keyboard,记住后面的ID,如我的ID为21. 输入命令,设置值为0 xinput 然后笔记本键盘就 ...
- mysql常用内置函数-查询语句中不能使用strtotime()函数!
来自:http://yushine.iteye.com/blog/775407 FROM_UNIXTIME把 unix时间戳转换为标准时间 unix_timestamp把标准时间转换为 unix时间戳 ...
- JS-模拟printf
function printf(){ var args = [].slice.call(arguments), fmt = args.shift(), args_index = 0; ///%(填充的 ...
- 在Stimulsoft Reports.Net运行时修改报表的连接字符串
怎么在Stimulsoft Reports.Net运行时修改报表的连接字符串?怎么改呀 C# StiReport report = new StiReport(); report.Load(" ...
- JSON.stringify,JSON.parse方法
var obj={name:'zhangsan',age:'18'};/** js对象--->JSON字符串* JSON.stringify(js对象) --转化为--> JSON字符串* ...
- Eclipes更改字体颜色
有图有真像 更改字体大小