spring mvc 后台java 查询数据库的数据时候报错 10C

![![图片说明](https://img-ask.csdn.net/upload/201805/04/1525364125_2454.jpg)图片说明](https://img-ask.csdn.net/upload/201805/04/1525364119_484515.png)图片说明

 @RequestMapping(value="/liuyan")
public ModelAndView liuyan(@RequestParam(value="liuyan", required=false) String liuyan, 
        HttpSession httpSession){
    System.out.println(liuyan);
    String sql = "select * from story where sname = '"+liuyan+"'";
    System.out.println(sql);
    String viewname="";
    final int[] isExist = new int[1];
    isExist[0] = 0;
    jt.query(sql, new RowCallbackHandler(){
        public void processRow(ResultSet rs) throws SQLException {
            if (rs.isFirst()) {
                isExist[0]=1;
            }
        }
    });
    if(isExist[0]==1) {
        String sql1 ="select * from '"+liuyan+"' limit 0,1000";
        System.out.println(sql1);
          viewname = "liuyan";
            final List<liuyan>liuyans = new ArrayList<liuyan>();
            jt.query(sql1, new RowCallbackHandler(){
                public void processRow(ResultSet rs1) throws SQLException {
                    System.out.println(rs1.getFetchSize());
                    while (!rs1.isAfterLast()) {
                        liuyan liuyanss = new liuyan(rs1.getString(1),
                                                rs1.getInt(2),
                                                rs1.getString(3),
                                                rs1.getString(4));
                        liuyans.add(liuyanss);
                        System.out.println(liuyans);
                        rs1.next();
                    }
                }
            });
            httpSession.setAttribute("liuyan", liuyan);
            System.out.println(liuyans.size());
            ModelAndView mv = new ModelAndView(viewname);
            mv.addObject("liuyans", liuyans);
            return mv;
    } else {
        httpSession.setAttribute("liuyan", liuyan);
        viewname = "chaxun_failed";
        ModelAndView mv = new ModelAndView(viewname);
        mv.addObject("liuyan", liuyan);

        return mv;

    }
   }
1

17个回答

图片说明

1

图片说明
很明显,是你String sql1 ="select * from '"+liuyan+"' limit 0,1000"; 这个sql有问题,表名都没有,liuyan是您转的表名吗?

1
qq_24932993
qq_24932993 回复janetdn: 已经解决了,可以用中文的,我用的mysql
一年多之前 回复
janetdn
他说历史与生活 您确认中文表名mybatis支持可以用吗?为什么不用英文的呢?
一年多之前 回复
qq_24932993
qq_24932993 是前面输入的input的值这里能读出来多嘛,那个东晋北府一丘八就是表名
一年多之前 回复

图片说明

0

图片说明

0

第二个就是这个数据库的表,第三个是报错情况,第一个是输入框

0

limit,mysql数据库可以用,其他数据库不行

0
qq_24932993
qq_24932993 就是mysql
一年多之前 回复

mysql可以用limit,oracle,sqlsever用rownumber

0

语法错误了,好好看看sql,表名没有

0

很明显,是你String sql1 ="select * from '"+liuyan+"' limit 0,1000"; 这个sql有问题,表名都没有, from什么呢,**不应该加单引号**

0
   if(isExist[0]==1) {
        String sql1 ="select * from '"+liuyan+"' limit 0,1000";

这一行的sql写错了,你把sname的参数当成表名拼写到sql里,按照你的业务,应该改成

 "select * from story where sname = '"+liuyan+"' limit 0,1000"
0
qq_24932993
qq_24932993 不是啊,我是先检查story表里面有没有在input里面输入的值的名称,有就进行下一把,在input里面输入的值的名称就是对应的小说留言表,然后把该小说留言表里面的第1到第1000条留言提取出来
一年多之前 回复
共17条数据 1 尾页
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring Mvc 查询数据库 问题
// 检索数据列表,放到返回结果对象中rn List> retList = dalClient.queryForList(pageSqlId, param.getQueryParam());rnrn执行这条语句的时候,rnrn 因为是数据库是别的系统导入过来的,查出来的一列有的值是“(null)”总是报rnrnorg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL state [null]; error code [-4220]; [jcc][t4][1065][12306][3.62.56] 捕获到 java.io.CharConversionException。有关详细信息,请参阅相连接的 Throwable。 ERRORCODE=-4220, SQLSTATE=null; nested exception is com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][3.62.56] 捕获到 java.io.CharConversionException。有关详细信息,请参阅相连接的 Throwable。 ERRORCODE=-4220, SQLSTATE=nullrn org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)rn org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:621)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rnrn众神可知道原因
新手求助。spring MVC,查询数据库,
由于是个新手,系统大部分代码,都是老人写的,现在要我做一个资料上传的页面和后台。spring的dao层,map,model都是“generatorConfiguration”自动生成的。n我需要写service接口,和serviceImpl,可是不知道怎么写啊?
spring mvc ajax请求的时候报错
javax.servlet.ServletException: Could not resolve view with name ‘userList’ in servlet with name ‘springMvc’ 1.请求的方法上加上@ResponseBody注解即可
spring mvc后台管理系统
简单后台管理系统 基于maven管理,整合最新spring mvc 4.3.3.RELEASE版整合了mybatis 3.4.1,涵盖了目前互联网web系统最流行的组件,log4j2日志、freemarker模板、protostuff序列化、fastjson、redis、spring-data-redis操作redis、spring-session-data-redis解决分布式统一session管理,也有junit4单元测试,前端jQuery、bootstrap、以及其他很多流行的js组件。目前已经完整整合,即可做为restapi也可作为前端展示,一般的业务可以基于此快速开发,大幅减少整合时间及试错时间。数据库使用mysql,建表脚本及初始化脚本都在src\resources\sql文件夹里
Spring MVC后台表单校验
Spring MVC后台表单校验使用了JSR-303的Java Validation API。 主要涉及三个方面: 1. Form Bean的验证规则注解 2. Controller处理方法参数注解 3. 利用Spring tag展现错误信息Form Bean的验证规则注解public class Spitter { private Long id; @NotNull @Size(m
js获取后台Spring MVC数据
后台Controller: @HtmlTitle(title = &quot;Statistic&quot;) @RequestMapping(&quot;/statistic&quot;) public String statistic(Model model){ List&amp;lt;SGo&amp;gt; sGos = sGoRepository.findAll(); model.addAt...
ajax获取后台数据+spring MVC
控制层通过map向前台传递数据   如:triggerList和size两个 @RequestMapping(value="/host/getTrigger", method = RequestMethod.POST ) @ResponseBody   public  Map  getTrigger(Integer templateId , Integer hostId) { Map mo
Spring mvc报错与解决方案
JSPs only permit GET POST or HEAD: @RequestMapping(value={"/testTest/{id}"}, method=RequestMethod.PUT) @ResponseBody //添加这一注解 public String putMethod(@PathVariable int id){ return "apa
spring mvc上传报错
[img=https://img-bbs.csdn.net/upload/201407/19/1405736858_958162.png][/img][img=https://img-bbs.csdn.net/upload/201407/19/1405736919_337316.png][/img]rn报[img=https://img-bbs.csdn.net/upload/201407/19/1405736956_373394.png][/img]
Spring MVC Junit单元测试报错
java.lang.ExceptionInInitializerErrorrn at org.springframework.mock.web.MockHttpServletResponse.(MockHttpServletResponse.java:76)rn at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:172)rn at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:100)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale zh_CNrn at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)rn at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)rn at java.util.ResourceBundle.getBundle(ResourceBundle.java:721)rn at javax.servlet.ServletOutputStream.(ServletOutputStream.java:87)rn ... 25 more
spring mvc查询报错
刚接触spring mvc,做了个简单的用户查询,然后用junit运行了下,包一下错误,实在没找到解决办法 ,望各位大神给予下帮助。[code=java]rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'test.Test': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private dimeng.modules.treasury.service.ITestService test.Test.testService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [dimeng.modules.treasury.service.ITestService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:385)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:363)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private dimeng.modules.treasury.service.ITestService test.Test.testService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [dimeng.modules.treasury.service.ITestService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 26 morernCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [dimeng.modules.treasury.service.ITestService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)rn ... 28 morern[/code]
spring mvc一直报错
[code=java]rn[size=13px][color=#FF0000]严重: java.io.FileNotFoundException: jndi:/localhost/spring%20mvc/WEB-INF/classes/net/spring/controller/HelloWorldController.class[/color][/size]rnjava.io.FileNotFoundException: jndi:/localhost/spring%20mvc/WEB-INF/classes/net/spring/controller/HelloWorldController.classrn at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:389)rn at java.net.URL.openStream(URL.java:1010)rn at com.sun.faces.config.AnnotationScanner.containsAnnotation(AnnotationScanner.java:515)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:467)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:459)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:459)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:459)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:416)rn at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:214)rn at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765)rn at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329)rn at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3920)rn at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1271)rn at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1440)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)rn at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)rn at java.lang.Thread.run(Thread.java:662)[/code]rnrn总感觉 严重: java.io.FileNotFoundException: jndi:/localhost/spring%20mvc/WEB-INF/classes/net/spring/controller/HelloWorldController.class 这一句话有问题,请教各位有没有遇到过这种问题。。。。。。
spring mvc 注入报错
错误信息如下:rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.service.UploadService com.controller.UploadController.uploadService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dao.UploadDao com.service.UploadService.uploadDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.core.JdbcTemplate com.dao.UploadDao.jdbcTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)rn at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)rn at javax.servlet.GenericServlet.init(GenericServlet.java:158)rn at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)rn at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:817)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)rn at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.service.UploadService com.controller.UploadController.uploadService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dao.UploadDao com.service.UploadService.uploadDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.core.JdbcTemplate com.dao.UploadDao.jdbcTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:571)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 36 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dao.UploadDao com.service.UploadService.uploadDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.core.JdbcTemplate com.dao.UploadDao.jdbcTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1145)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1069)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:967)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:543)rn ... 38 morern....
spring mvc 请求报错
No mapping found for HTTP request with URI [/Springmvc/test] in DispatcherServlet with dispatche 原因:表单有日期,实体对应字段也是日期类型,所以报错,把实体和库字段设置程String,就会成功保存。 ERROR [org.springframework.web.context.Context...
java spring mvc 上传文件前台layui 后台
/*html*/     &amp;lt;td&amp;gt;         &amp;lt;input id=&quot;EMP_REFERENCE_PROOF&quot; label=&quot;初次参加工作日期证明&quot; name=&quot;EMP_REFERENCE_PROOF&quot; type=&quot;hidden&quot; value=&quot;&amp;lt;%=pageBean.inputValue(&quot;EMP_REFERENCE_PROOF&quot;)%&a
java web项目spring mvc前端后台交数据互问题
后台的controller方法返回ModelAndView,代码如下:rn[code=java]rnModelAndView modelAndView = new ModelAndView();rnList userList = new ArrayList<>();rnmodelAndView.addObject("userList", userList);rnmodelAndView.setViewName("jsp1");rn[/code]rn其中User类为自定义的pojo类,有个String类型的name属性,代码中省略了往userList中添加数据的操作。在jsp1这个jsp页面有如下一段代码:rn[code=javascript]rn rn[/code]rn怎么在这段js代码中获取并遍历后台传过来的userList,然后将每个user的name存到arr这个数组里?
(报错)mybatis连接数据库——查询数据库数据
这个我真想打死自己啊,我用mybatis连接数据库,然后只导入了mybatis的jar包,一运行类啊,就报如下的错: 我竟然还仔细的分析了一下,这个问题,看看是不是我的SQL语句写的不对,再三核实后,确实是跟数据库没有什么不同啊,然后我就放了一会。 一会后,我再去看那个的时候,从头想了想,我是要链接数据库的,首先当然是要导入mysql的jar包了,哎~...
spring MVC传对象到后台
前台:       $(document).ready(function(){          var saveDataAry=[];                                          //这就是一个list: List users         var data1={"userName":"test","address":"gz"};  //这就是
spring mvc后台获取checkbox
rnrn $status.index+1 rn rn rnrnrn后台获取,用的spring mvc,没有用参数绑定,直接用request获取参数rnString[] ind= request.getParameterValues("ind");rnString[] doc = request.getParameterValues("doc");rn如果选择checkbox的value大于1000就无法获取到值,相当于行数超过1000的就传递不到后台rn而doc就没有这个限制,这是为什么呢
求spring mvc后台拦截器
需要spring mvc后台的拦截器,目的是只拦截后台,前台的放过去。
查询数据库报错
<%rnSet conn = server.CreateObject("adodb.connection")rnconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("jackguestbook.mdb")rn'conn.open "driver=microsoft access driver (*.mdb);dbq="&server.mappath("jackguestbook.mdb")rnDim a rna="nn"rnexec = "select * from guestbook"+" where name="+arnSet rs = server.CreateObject("adodb.recordset")rnrs.open exec,conn,1,1rn%>rn我想从数据库中查找姓名为jack的人的数据,它怎么报rn“一个以上的参数必须设定”的错呢
Freemarker 结合 Spring mvc 报错
[b]应该是配置文件的问题,看看这样配置对不对?[/b]rnrn[code=text]rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn[/code]
Spring MVC之不报错的404错误
额,其实就是学习MVC期间发生了一个小插曲,我是完全按照设计规范来做的,而且配置文件也检查了好几遍程序就是一个hello程序很干净简洁……但是,就是运行之后显示404错误,在controller里打印的代码看不见说明根本就没进入controller,如果您也出现这样的问题别看控制台了,因为控制台并不能提供什么有效的信息,您可以看那一下problem那个模块,里面是不是报了跟jre或者jdk有关的错
Spring mvc 文件上传接口报错
Could not instantiate bean class [org.springframework.web.multipart.commons.CommonsMultipartFile]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframewor
spring mvc报错,如何解决?
严重: Servlet.service() for servlet dispatcher threw exceptionrnrnorg.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException: No matching handler method found for servlet request: path '/login.xhtml', method 'GET', parameters map['op' -> array['valiCodeRedir']]
跪求帮助 Spring mvc 报错
在使用spring2.5时,采用spring2.5的注解MVC 出现错误rn配置文件rnrnrn rn rn rnrn报错信息:rnorg.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]rnOffending resource: ServletContext resource [/WEB-INF/dispatcherContext.xml]rnrn解决了半天了,就不知道怎么回事,请帮忙,谢谢了
spring mvc环境部署报错
如下图,我部署spring mvc时报java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServet,当点击链接时就报404,请问这怎么解决?n![图片说明](https://img-ask.csdn.net/upload/201706/15/1497459159_140598.png)n![图片说明](https://img-ask.csdn.net/upload/201706/15/1497459332_743129.png)
Spring MVC 之数据格式化
Spring MVC 之数据格式化   描述   Spring3引入了格式化转换器(Formatter SPI) 和格式化服务API(FormattingConversionService)从而支持将数据进行格式化后显示。   Formatter SPI核心是完成解析和格式化转换逻辑,在如Web应用/客户端项目中,需要解析、打印/展示本地化的对象值时使用,如根据Locale信息将ja...
Spring Mvc数据的处理
1.提交数据的处理 提交的域名称和处理方法的参数一致即可。 http://localhost:8088/SpringMvcData/hello.do?name=zhangsan处理方法: @RequestMapping("hello.do") public String hello(String name){ System.out.println(name); return "in
Spring MVC的数据处理方式
Spring MVC怎么接收处理传进来的数据
请求后台数据报错
这个错误 :fetch.js中code  来自于 控制台code 后的数字来源于请求成功后 上图code 后面的数据  
cfx Spring 和 Spring MVC一起用报错
问题描述:rn 在做WebService的时候,用CFX技术和Spring进行整合,然后通过WebService的方法调用业务逻辑代码,[u][b]发现用Spring的依赖注入没有成功(失效)[/b][/u]。去调web.xml中有关WebService代码,程序运行成功。rnrnweb.xml文件如下rnrn[code=java]rnrnrn rn contextConfigLocationrn /WEB-INF/beanRefServer.xmlrn rn rn CXFServletrn rn org.apache.cxf.transport.servlet.CXFServletrn rn 0rn rn rn CXFServletrn /services/*rn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn Set Character Encodingrn rn org.springframework.web.filter.CharacterEncodingFilterrn rn rn encodingrn UTF-8rn rn rn forceEncodingrn truern rn rn rn Set Character Encodingrn /*rn rn rn rn spring3rn rn org.springframework.web.servlet.DispatcherServletrn rn 1rn rnrn rn spring3 rn /rn rn rn index.jsprn rnrn[/code]rnrnController代码rn[code=java]rn@Controllerrn@RequestMapping("/user")rnpublic class UserController rn rn private IUserService userServer;rn private IDeptService deptServer;rn rn public IDeptService getDeptService() rn return deptServer;rn rnrn public void setDeptService(IDeptService deptServer) rn this.deptServer = deptServer;rn rnrn public IUserService getUserService() rn return userServer;rn rnrn public void setUserService(IUserService userServer) rn this.userServer = userServer;rn rnrn @RequestMapping(value="/login",method=RequestMethod.POST)rn public String login(@RequestParam String name,@RequestParam String password,Model model,HttpServletRequest request) throws Exceptionrn TUser user1 = userServer.getUserByName(name);rn if(user1 == null) rn model.addAttribute("message", "用户不存在");rn return "login";rn else if(password == null || !password.equals(user1.getPassword()) )rn model.addAttribute("message", "密码错误");rn return "login";rn else rn request.getSession().setAttribute(Constants.USER_INFO_SESSION, user1);rn return "welcome";rn rn rn以下略...rn[/code]rnrn上面代码中 login()方法时,userServer为null,注入没有成功,请问为何rnrn
java spring mvc
java spring mvc集成hibernate4 数据库为sqlserver本地测试通过
java spring mvc之文件上传
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML序列图和流程图 离线写博客 导入导出Markdown文件 丰富的快捷键 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
java spring mvc 设计
Spring MVC 3学习笔记+教程 这是一个学习spring mvc设计模式很好的参考文档,希望大家可以从中学到东西
Java——spring mvc 文件下载
准备工作: 1、添加jar包 commons-fileupload-1.2.2.jar、commons-io-2.4.jar 2、配置spring-mvc.xlm配置文件 3、controller代码示例 @RequestMapping(value = "download", method = RequestMethod.GET) public
MVC返回JsonResult数据报错
[code=csharp] private void SetUpCustomerIDSearchDropDown(JQGrid ordersGrid)rn rn // setup the grid search criteria for the columnsrn JQGridColumn customersColumn = ordersGrid.Columns.Find(c => c.DataField == "CustomerID");rn customersColumn.Searchable = true;rnrn // DataType must be set in order to use searchingrn customersColumn.DataType = typeof(string);rn customersColumn.SearchToolBarOperation = SearchOperation.IsEqualTo;rn customersColumn.SearchType = SearchType.DropDown;rnrn // Populate the search dropdown only on initial request, in order to optimize performancern if (ordersGrid.AjaxCallBackMode == AjaxCallBackMode.RequestData)rn rn //var northWindModel = new NorthwindDataContext();rn NorthwindEntities db = new NorthwindEntities();rn rn //var searchList = from customers in northWindModel.Customersrn var searchList = from customers in db.Customersrn select new SelectListItemrn rn Text = customers.CustomerID,rn Value = customers.CustomerIDrn ;rnrn customersColumn.SearchList = searchList.ToList();rn customersColumn.SearchList.Insert(0, new SelectListItem Text = "All", Value = "" );rn rn [/code]rnController里有这个action,返回时rncustomersColumn.SearchList没有获得数据rn报错“未能计算表达式的值”。rn在原例子的解决方案里就OK。rn求大神帮助。
C# 后台查询数据库
int[] asd=new int[9];rnrn asd[0]=15;rn asd[1]=26;rn asd[2]=32;rn asd[3]=45;rn asd[4]=56;rn asd[5]=67;rn asd[6]=72;rn asd[7]=85;rn asd[8]=97;rnrn以上这个数组是数据库内指定数据的主键ID,Select * from shik where (这里怎么写 通过数组 asd)rn求救
询问Spring mvc +IBatis后台如何获取前台数据
数据库是可以连接上的,前台调用请求,后台如何获得前台的数据,加入到sql语句中进行查询?rn新手刚开始搞这个,最简单的一个数据查询功能
spring mvc后台怎么接收dwz的ajax form提交的数据
前台有个form表单,使用的是dwz的,因为是查询数据,所以,就使用到了dwz的ajax表单查询,但是我不知道后台应该怎么接收参数。前台onsubmit的时候调用了一个js函数 rn function navTabSearch(form) rn navTab.reload(form.action, $(form).serializeArray()); rn return false; rn rnrnform表单中有个字段from_date,可是我从后台接收不到,所以请大神指教后台的spring mvc怎么接收参数呢?
相关热词 c#串口测试应用程序 c# 匹配 正则表达式 c#防止窗体重绘 c#读写txt文件 c#挖地雷源代码 c#弹框选项 c# 移除 队列 c# 密码写入配置文件 c# 获取可用内存大小 c# 嵌入excel编辑