精华内容
下载资源
问答
  • SSH项目搭建

    2019-04-23 16:06:23
    测试

    测试

    展开全文
  • SSH项目搭建环境

    2017-04-04 11:15:44
    SSH项目搭建环境
  • ssh项目搭建

    2017-03-16 22:32:19
    项目的resource文件夹中创建applicationContext.xml文件,用来配置spring和struts及spring和hibernate之间的关系 <!--创建数据源--> < bean id = "dataSource" class = "org.apache.commons.dbcp....

    文中的版本是spring5 hibernate5 struts2.5
    maven中添加依赖

      <properties>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.source>1.8</maven.compiler.source>
            <spring.version>4.3.7.RELEASE</spring.version>
            <struts.version>2.5.10.1</struts.version>
            <dbcp.version>1.4</dbcp.version>
            <mysql.version>6.0.6</mysql.version>
            <mybaties.version>3.4.2</mybaties.version>
            <hibernate.version>5.2.8.Final</hibernate.version>
            <struts.spring.version>2.5.10.1</struts.spring.version>
            <struts.tglib.version>1.3.10</struts.tglib.version>
        </properties>
      <dependencies>
          <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-context</artifactId>
              <version>${spring.version}</version>
          </dependency>
          <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-web</artifactId>
              <version>${spring.version}</version>
          </dependency>
          <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-orm</artifactId>
              <version>${spring.version}</version>
          </dependency>
    
          <dependency>
              <groupId>org.apache.struts</groupId>
              <artifactId>struts2-core</artifactId>
              <version>${struts.version}</version>
          </dependency>
          <dependency>
              <groupId>org.apache.struts</groupId>
              <artifactId>struts-taglib</artifactId>
              <version>${struts.tglib.version}</version>
          </dependency>
          <dependency>
              <groupId>org.apache.struts</groupId>
              <artifactId>struts2-spring-plugin</artifactId>
              <version>${struts.spring.version}</version>
          </dependency>
          <dependency>
              <groupId>commons-dbcp</groupId>
              <artifactId>commons-dbcp</artifactId>
              <version>${dbcp.version}</version>
          </dependency>
          <dependency>
              <groupId>mysql</groupId>
              <artifactId>mysql-connector-java</artifactId>
              <version>${mysql.version}</version>
          </dependency>
          <dependency>
              <groupId>org.mybatis</groupId>
              <artifactId>mybatis</artifactId>
              <version>${mybaties.version}</version>
          </dependency>
          <dependency>
              <groupId>org.hibernate</groupId>
              <artifactId>hibernate-core</artifactId>
              <version>${hibernate.version}</version>
          </dependency>
      </dependencies>

    在项目的web.xml文件中创建struts的过滤器和spring的监听

    <filter>
          <filter-name>struts2</filter-name>
          <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
      </filter>
       <filter-mapping>
           <filter-name>struts2</filter-name>
           <url-pattern>*.action</url-pattern>
       </filter-mapping>
          <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext.xml</param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener> 

    在项目的resource文件夹中创建applicationContext.xml文件,用来配置spring和struts及spring和hibernate之间的关系

        <!--创建数据源-->
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
            <property name="url" value="jdbc:mysql://localhost:3306/sopping?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC"></property>
            <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
            <property name="username" value="root"></property>
            <property name="password" value="chen"></property>
        </bean>
            <!--
            创建sessionFactory,为了dao使用
            这里需要注意的是要进行hibernate的配置文件的导入
            还要配置扫描实体类映射文件
            -->
           <!--设置hibernate的属性-->
        <bean id="properties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
                <property name="properties" >
                    <props>
                        <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                        <prop key="show_sql">true</prop>
                    </props>
                </property>
        </bean>
        <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
            <property name="dataSource" ref="dataSource"></property>
            <property name="hibernateProperties" ref="properties"></property>
            <property name="packagesToScan" value="com.chen.entity"></property>
        </bean>
        <!--配置dao-->
        <bean id="dao" class="com.chen.dao.DaoImpl">
            <property name="sessionFactory" ref="sessionFactory"></property>
        </bean>

    在resource中创建struts.xml文件

    <struts>
        <package name="default" namespace="/" extends="struts-default">
            <!--struts2.5默认使用通配符不生效,要加入如下配置-->
            <global-allowed-methods>regex:.*</global-allowed-methods>
            <action name="login*" class="loginAction" method="{1}">
                <result name="login">index.jsp</result>
            </action>
        </package>
    </struts>

    现在我们可以创建相应的包路径ssh项目结构

    我们的dao如下创建
    这里写图片描述

    展开全文
  • SSH项目搭建步骤简单示例,SSH项目搭建步骤简单示例,SSH项目搭建步骤简单示例,SSH项目搭建步骤简单示例,SSH项目搭建步骤简单示例
  • SSH项目搭建报错

    2019-12-27 15:15:55
    SSH项目搭建报错 XML文件里配置DataSource 导入orm包了但还是报红 控制台报错 Context initialization failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ...

    SSH项目搭建报错

    XML文件里配置DataSource
    在这里插入图片描述
    导入orm包了但还是报红

    控制台报错

    Context initialization failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'doctorMemberServiceImpl': Unsatisfied dependency expressed through field 'doctorMemberDao'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate5.annotation.AnnotationSessionFactoryBean] for bean with name 'sessionFactoryForHsplatform' defined in ServletContext resource [/WEB-INF/classes/applicationContext-hibernate.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate5.annotation.AnnotationSessionFactoryBean
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
    	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5197)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5720)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1899)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:619)
    	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:566)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    	at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
    	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
    	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
    	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
    	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
    	at sun.rmi.transport.Transport$1.run(Transport.java:200)
    	at sun.rmi.transport.Transport$1.run(Transport.java:197)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate5.annotation.AnnotationSessionFactoryBean] for bean with name 'sessionFactoryForHsplatform' defined in ServletContext resource [/WEB-INF/classes/applicationContext-hibernate.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate5.annotation.AnnotationSessionFactoryBean
    	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1392)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:680)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:647)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1518)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:507)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:485)
    	at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:227)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1411)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1210)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
    	... 62 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.orm.hibernate5.annotation.AnnotationSessionFactoryBean
    	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1955)
    	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1798)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:348)
    	at org.springframework.util.ClassUtils.forName(ClassUtils.java:275)
    	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:437)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1457)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1384)
    	... 72 more
    

    小白求大神指教 ==##

    展开全文
  • Eclipse 中 SSH 项目搭建图文教程(一)-附件资源
  • SSH项目搭建-准备

    2019-09-30 00:07:48
    SSH项目搭建 1.创建工程--tomcat 2.创建we/web-inf/lib文件夹,引入全部jar包 3.创建配置文件夹resource将配置文件放入 4.建立相应的数据库,并修改jdbc.properties文件中的相关信息 5.开启注解功能 6.将...

    SSH项目搭建

    1.创建工程--tomcat

    2.创建we/web-inf/lib文件夹,引入全部jar包

     

    3.创建配置文件夹resource将配置文件放入

     

     4.建立相应的数据库,并修改jdbc.properties文件中的相关信息

    5.开启注解功能

    6.将前端页面放到web目录中

    7.设置默认浏览器并开启热部署

    8.配置核心过滤器,spring监听器,设置欢迎页面(web.xml文件)【固定写法】

    <?xml version="1.0" encoding="UTF-8"?>
        <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
                 version="4.0">
    
        <!--配置核心过滤器-->
        <filter>
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>struts2</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    
        <!-- Spring的核心监听器 -->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <!-- 加载Spring的配置文件的路径的,默认加载的/WEB-INF/applicationContext.xml -->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext.xml</param-value>
        </context-param>
    
        <!--设置欢迎页 服务器一启动就会跳转的页面-->
        <welcome-file-list>
            <welcome-file>mgr_login.jsp</welcome-file>
        </welcome-file-list>
    </web-app>

     

    展开全文
  • SSH项目搭建步骤

    2015-01-30 14:28:45
    ssh项目在Eclipse下的搭建步骤,所需jar包及文件配置。
  • ssh项目搭建后的简化

    2016-10-24 19:16:00
    SSH项目搭建后的简化  上次说完ssh框架的搭建,这个框架本身没什么问题,但可以通过使用spring注解来使代码更加简洁、提高阅读性。  一、在原来的框架上简化了以下几点:  1.原来的属性set注入改为注解 ...
  • 本文采用ecplipse搭建了一个简单的SSH项目,并提供了示例项目,适合初学者入门。文章可能还有很多不足,请大家谅解,欢迎大佬提意见。 本文使用到的东西 struts 2.5.22 spring 5.2.3 hibernate 5.4.10 java 12.0.2 ...
  • 这一篇是承接上一篇文章《Eclipse中SSH项目搭建图文教程(一)》写的,在前一篇文章搭建的环境及新建项目的基础上,主要说一说整合 Hibernate 部分。
  • 这一篇是承接上一篇文章《Eclipse中SSH项目搭建图文教程(二)》写的,在前一篇文章搭建的环境及新建项目的基础上,主要说一说整合 Spring 部分。
  • SSH项目搭建实例(一)----部分注解实现简单员工管理系统 运行环境:eclipse+tomcat 8.5+MySQL 项目搭建:spring 4.*+struts 2+hibernate(3) 本项目基于Dynamic web项目基础上进行搭建SSH框架,未用到maven,因此...
  • Maven Web+SSH 项目搭建(Eclipse)

    千次阅读 2017-07-08 15:33:59
    Maven Web+SSH 项目搭建(Eclipse) 配置环境:eclipse Neon Release (4.6.0) 、Tomcat-8.0.41、Apache-maven-3.5.0、Java1.8.0_121 以上环境搭建:...
  • SSH项目搭建详解

    2020-04-02 16:35:43
    <property name="driverClass" value="com.mysql.jdbc.Driver">property> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/SSH_CRM?characterEncoding=UTF-8">property> ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,180
精华内容 1,272
关键字:

ssh项目搭建