`

Spring app 使用包的简化和注意的问题

阅读更多

      众所周知spring框架是一个非常优秀的轻量级框架工具,我们借助它可以简单的将软件各个部分割裂开以实现较低的耦合度。
那么我们在有些时候强外界发布这些软件时面临着一个选择--是否将spring的相关包一起发布,如果全部一齐发布则可能使原本非常小巧的程式变得非常庞大;
如果不发布则可能使客户端面临程式工作环境配置的复杂程度加大,在这里主要是spring框架的下载、配置和使用。
      基于以上情况我们选择一个折衷的办法:将spring工作必须的基本类文件和相关配置文件与我们的程式一起发布出去。在这里的问题就主要是包的选择(类相互的依赖关系)和框架类的一些配置文件的选择使用。
      由于我的经历有限,在此我就将我写的一个第三方eclipse插件管理器所面临的一些问题以及获得的经验和大家分享一下。在这里我将用一个简单的spring例子作为替代说明即可。

#System environment
Ubuntu 
7.10  Linux
Eclipse Platform Version:  3.3.0  + MyEclipse  6.0

      其中spring框架的加载和配置是通过MyEclipse的插件(MyEclipse-->Project Capabilities-->Add Spring ...-->Spring 2.0 Core ...)实现的。
      以下是一个简单的spring使用的程式代码:

<? xml version="1.0" encoding="UTF-8" ?>
< beans
    
xmlns ="http://www.springframework.org/schema/beans"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation
="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
>
    
    
    
< bean  id ="HelloWorld"  class ="springapp.hello.HelloWorld" >
        
< property  name ="message" >
            
< value > world </ value >
        
</ property >
    
</ bean >


</ beans >

 

package  springapp.hello;

public   interface  Hello  ... {
    
public  String sayHello();
}

 

package  springapp.hello;

public   class  HelloWorld  implements  Hello ... {
    
private  String message;
    
    
public  HelloWorld() ... {
        message
= null ;
    }

    
    
public  String sayHello() ... {
        
return   " Hello  " + message + " ! " ;
    }


    
public  String getMessage()  ... {
        
return  message;
    }


    
public   void  setMessage(String message)  ... {
        
this .message  =  message;
    }


}

 

package  springapp.main;

import  org.springframework.context.ApplicationContext;
import  org.springframework.context.support.FileSystemXmlApplicationContext;

import  springapp.hello.Hello;

public   class  Main  ... {

    
/** */ /**
     * 
@param  args
     
*/

    
public   static   void  main(String[] args)  ... {
        ApplicationContext ctx 
=   new  FileSystemXmlApplicationContext(
                
" /src/applicationContext.xml " );
        Hello h 
=  (Hello)ctx.getBean( " HelloWorld " );
        System.out.println(h.sayHello());
    }


}


最后运行Main类就会显示一些信息:

2008 - 02 - 14   14 : 50 : 55 , 954  INFO
 
[ org.springframework.context.support.FileSystemXmlApplicationContext ]
 - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext
@f3d6a5: display name
 
[ org.springframework.context.support.FileSystemXmlApplicationContext@f3d6a5 ]
;  startup date [Thu Feb 14 14:50:55 CST 2008]; root of context hierarchy
2008 - 02 - 14   14 : 50 : 56 , 013  INFO
 
[ org.springframework.beans.factory.xml.XmlBeanDefinitionReader ]
- Loading XML bean definitions from file
 
[ /home/wpc/workspace/Java/MyStudy/SimplifySpringCoreJar/src/applicationContext.xml ]
2008 - 02 - 14   14 : 50 : 56 , 197  INFO
[ org.springframework.context.support.FileSystemXmlApplicationContext ]
- Bean factory for application context
[ org.springframework.context.support.FileSystemXmlApplicationContext@f3d6a5 ]
: org.springframework.beans.factory.support.DefaultListableBeanFactory@f7f540
2008 - 02 - 14   14 : 50 : 56 , 210  INFO
[ org.springframework.beans.factory.support.DefaultListableBeanFactory ]
 - Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@f7f540
: defining beans 
[ HelloWorld ] ;  root of factory hierarchy
Hello world!

由于有个log配置文件的问题可能有些程式运行会有警告信息,这个不要紧,不再讨论范畴。
我的解决方案是:

#   For  JBoss: Avoid to setup Log4J outside  $ JBOSS_HOME / server / default / deploy / log4j . xml!
#   For  all other servers: Comment out the Log4J listener in web . xml to activate Log4J .
log4j
. rootLogger = INFO ,  stdout ,  logfile

log4j
. appender . stdout = org . apache . log4j . ConsoleAppender
log4j
. appender . stdout . layout = org . apache . log4j . PatternLayout
log4j
. appender . stdout . layout . ConversionPattern = %d %p [%c] - %m%n

log4j
. appender . logfile = org . apache . log4j . RollingFileAppender

#  The log file's location
log4j
. appender . logfile . File = springframe_log . log
log4j
. appender . logfile . MaxFileSize = 512KB

#  Keep three  backup   files .
log4j
. appender . logfile . MaxBackupIndex = 3

#  Pattern to output: data  priority  [category] -message
log4j
. appender . logfile . layout = org . apache . log4j . PatternLayout
log4j
. appender . logfile . layout . ConversionPattern = %d %p [%c] - %m%n

      文件命名为log4j.properties然后打包jar并且导入即可。
      但是如果将这个工程导出,一般是不携带spring框架类文件的,这时在外部运行Main类就可能出现问题,一般提示是spring相关的类文件无法找到。我当时就是通过这样一些错误信息一步步补全我的spring基础类文件的,应该有相关的工具但是我没有找到。
      在这里我就将我的结果给大家:

/**/**
.:
META-INF
org

./META-INF:
spring.schemas

./org:
apache
springframework

./org/apache:
commons

./org/apache/commons:
logging

./org/apache/commons/logging:
impl
Log.class
LogConfigurationException.class
LogFactory$1.class
LogFactory$2.class
LogFactory$3.class
LogFactory$4.class
LogFactory$5.class
LogFactory.class
LogSource.class

./org/apache/commons/logging/impl:
AvalonLogger.class
Jdk13LumberjackLogger.class
Jdk14Logger.class
Log4JLogger.class
LogFactoryImpl.class
LogKitLogger.class
NoOpLog.class
ServletContextCleaner.class
SimpleLog$1.class
SimpleLog.class
WeakHashtable$1.class
WeakHashtable$2.class
WeakHashtable.class
WeakHashtable$Entry.class
WeakHashtable$Referenced.class
WeakHashtable$WeakKey.class

./org/springframework:
beans
context
core
util

./org/springframework/beans:
AbstractPropertyAccessor.class
annotation
BeanInstantiationException.class
BeanMetadataElement.class
BeansException.class
BeanUtils.class
BeanWrapper.class
BeanWrapperImpl$1.class
BeanWrapperImpl.class
BeanWrapperImpl$PropertyTokenHolder.class
CachedIntrospectionResults.class
ConfigurablePropertyAccessor.class
DirectFieldAccessor$1.class
DirectFieldAccessor.class
factory
FatalBeanException.class
InvalidPropertyException.class
Mergeable.class
MethodInvocationException.class
MutablePropertyValues.class
NotReadablePropertyException.class
NotWritablePropertyException.class
NullValueInNestedPathException.class
PropertyAccessException.class
PropertyAccessor.class
PropertyAccessorUtils.class
PropertyBatchUpdateException.class
PropertyEditorRegistrar.class
PropertyEditorRegistry.class
PropertyEditorRegistrySupport$1.class
PropertyEditorRegistrySupport.class
PropertyEditorRegistrySupport$CustomEditorHolder.class
propertyeditors
PropertyMatches.class
PropertyValue.class
PropertyValues.class
PropertyValuesEditor.class
SimpleTypeConverter.class
support
TypeConverter.class
TypeConverterDelegate.class
TypeMismatchException.class

./org/springframework/beans/annotation:
AnnotationBeanUtils.class

./org/springframework/beans/factory:
access
annotation
BeanClassLoaderAware.class
BeanCreationException.class
BeanCreationNotAllowedException.class
BeanCurrentlyInCreationException.class
BeanDefinitionStoreException.class
BeanFactoryAware.class
BeanFactory.class
BeanFactoryUtils.class
BeanInitializationException.class
BeanIsAbstractException.class
BeanIsNotAFactoryException.class
BeanNameAware.class
BeanNotOfRequiredTypeException.class
CannotLoadBeanClassException.class
config
DisposableBean.class
FactoryBean.class
FactoryBeanNotInitializedException.class
generic
HierarchicalBeanFactory.class
InitializingBean.class
ListableBeanFactory.class
NamedBean.class
NoSuchBeanDefinitionException.class
ObjectFactory.class
parsing
SmartFactoryBean.class
support
UnsatisfiedDependencyException.class
wiring
xml

./org/springframework/beans/factory/access:
BeanFactoryLocator.class
BeanFactoryReference.class
BootstrapException.class
SingletonBeanFactoryLocator$1.class
SingletonBeanFactoryLocator$BeanFactoryGroup.class
SingletonBeanFactoryLocator.class

./org/springframework/beans/factory/annotation:
AnnotationBeanWiringInfoResolver.class
Autowire.class
Configurable.class
RequiredAnnotationBeanPostProcessor.class
Required.class

./org/springframework/beans/factory/config:
AbstractFactoryBean$1.class
AbstractFactoryBean.class
AutowireCapableBeanFactory.class
BeanDefinition.class
BeanDefinitionHolder.class
BeanDefinitionVisitor.class
BeanFactoryPostProcessor.class
BeanPostProcessor.class
BeanReference.class
BeanReferenceFactoryBean.class
CommonsLogFactoryBean.class
ConfigurableBeanFactory.class
ConfigurableListableBeanFactory.class
ConstructorArgumentValues.class
ConstructorArgumentValues$ValueHolder.class
CustomEditorConfigurer.class
CustomScopeConfigurer.class
DestructionAwareBeanPostProcessor.class
FieldRetrievingFactoryBean.class
InstantiationAwareBeanPostProcessorAdapter.class
InstantiationAwareBeanPostProcessor.class
ListFactoryBean.class
MapFactoryBean.class
MethodInvokingFactoryBean.class
ObjectFactoryCreatingFactoryBean$1.class
ObjectFactoryCreatingFactoryBean.class
PreferencesPlaceholderConfigurer.class
PropertiesFactoryBean.class
PropertyOverrideConfigurer.class
PropertyPathFactoryBean.class
PropertyPlaceholderConfigurer.class
PropertyPlaceholderConfigurer$PlaceholderResolvingBeanDefinitionVisitor.class
PropertyResourceConfigurer.class
ResourceFactoryBean.class
RuntimeBeanNameReference.class
RuntimeBeanReference.class
Scope.class
ServiceLocatorFactoryBean$1.class
ServiceLocatorFactoryBean.class
ServiceLocatorFactoryBean$ServiceLocatorInvocationHandler.class
SetFactoryBean.class
SingletonBeanRegistry.class
SmartInstantiationAwareBeanPostProcessor.class
TypedStringValue.class

./org/springframework/beans/factory/generic:
GenericBeanFactoryAccessor.class

./org/springframework/beans/factory/parsing:
AbstractComponentDefinition.class
AliasDefinition.class
BeanComponentDefinition.class
BeanDefinitionParsingException.class
BeanEntry.class
ComponentDefinition.class
CompositeComponentDefinition.class
ConstructorArgumentEntry.class
DefaultsDefinition.class
EmptyReaderEventListener.class
FailFastProblemReporter.class
ImportDefinition.class
Location.class
NullSourceExtractor.class
ParseState.class
ParseState$Entry.class
PassThroughSourceExtractor.class
Problem.class
ProblemReporter.class
PropertyEntry.class
ReaderContext.class
ReaderEventListener.class
SourceExtractor.class

./org/springframework/beans/factory/support:
AbstractAutowireCapableBeanFactory.class
AbstractAutowireCapableBeanFactory$ConstructorResolverAdapter.class
AbstractBeanDefinition.class
AbstractBeanDefinitionReader.class
AbstractBeanFactory$1.class
AbstractBeanFactory$2.class
AbstractBeanFactory.class
AutowireUtils$1.class
AutowireUtils.class
BeanDefinitionBuilder.class
BeanDefinitionReader.class
BeanDefinitionReaderUtils.class
BeanDefinitionRegistry.class
BeanDefinitionValidationException.class
BeanDefinitionValueResolver.class
BeanNameGenerator.class
CglibSubclassingInstantiationStrategy$1.class
CglibSubclassingInstantiationStrategy$CglibSubclassCreator$CallbackFilterImpl.class
CglibSubclassingInstantiationStrategy$CglibSubclassCreator$CglibIdentitySupport.class
CglibSubclassingInstantiationStrategy$CglibSubclassCreator.class
CglibSubclassingInstantiationStrategy$CglibSubclassCreator$LookupOverrideMethodInterceptor.class
CglibSubclassingInstantiationStrategy$CglibSubclassCreator$ReplaceOverrideMethodInterceptor.class
CglibSubclassingInstantiationStrategy.class
ChildBeanDefinition.class
ConstructorResolver$ArgumentsHolder.class
ConstructorResolver.class
DefaultBeanNameGenerator.class
DefaultListableBeanFactory.class
DefaultSingletonBeanRegistry.class
DisposableBeanAdapter.class
InstantiationStrategy.class
LookupOverride.class
ManagedList.class
ManagedMap.class
ManagedProperties.class
ManagedSet.class
MethodOverride.class
MethodOverrides.class
MethodReplacer.class
PropertiesBeanDefinitionReader.class
ReplaceOverride.class
RootBeanDefinition.class
SimpleInstantiationStrategy.class
StaticListableBeanFactory.class

./org/springframework/beans/factory/wiring:
BeanConfigurerSupport.class
BeanWiringInfo.class
BeanWiringInfoResolver.class
ClassNameBeanWiringInfoResolver.class

./org/springframework/beans/factory/xml:
AbstractBeanDefinitionParser.class
AbstractSimpleBeanDefinitionParser.class
AbstractSingleBeanDefinitionParser.class
BeanDefinitionDecorator.class
BeanDefinitionDocumentReader.class
BeanDefinitionParser.class
BeanDefinitionParserDelegate.class
BeansDtdResolver.class
DefaultBeanDefinitionDocumentReader.class
DefaultDocumentLoader.class
DefaultNamespaceHandlerResolver.class
DelegatingEntityResolver.class
DocumentDefaultsDefinition.class
DocumentLoader.class
NamespaceHandler.class
NamespaceHandlerResolver.class
NamespaceHandlerSupport.class
ParserContext.class
PluggableSchemaResolver.class
ResourceEntityResolver.class
SimplePropertyNamespaceHandler.class
spring-beans-2.0.dtd
spring-beans-2.0.xsd
spring-beans.dtd
spring-tool-2.0.xsd
spring-util-2.0.xsd
UtilNamespaceHandler$1.class
UtilNamespaceHandler.class
UtilNamespaceHandler$ConstantBeanDefinitionParser.class
UtilNamespaceHandler$ListBeanDefinitionParser.class
UtilNamespaceHandler$MapBeanDefinitionParser.class
UtilNamespaceHandler$PropertiesBeanDefinitionParser.class
UtilNamespaceHandler$PropertyPathBeanDefinitionParser.class
UtilNamespaceHandler$SetBeanDefinitionParser.class
XmlBeanDefinitionParser.class
XmlBeanDefinitionReader.class
XmlBeanDefinitionStoreException.class
XmlBeanFactory.class
XmlReaderContext.class

./org/springframework/beans/propertyeditors:
ByteArrayPropertyEditor.class
CharacterEditor.class
CharArrayPropertyEditor.class
ClassArrayEditor.class
ClassEditor.class
CustomBooleanEditor.class
CustomCollectionEditor.class
CustomDateEditor.class
CustomMapEditor.class
CustomNumberEditor.class
FileEditor.class
InputStreamEditor.class
LocaleEditor.class
PatternEditor.class
PropertiesEditor.class
ResourceBundleEditor.class
StringArrayPropertyEditor.class
StringTrimmerEditor.class
URIEditor.class
URLEditor.class

./org/springframework/beans/support:
ArgumentConvertingMethodInvoker.class
MutableSortDefinition.class
PagedListHolder.class
PagedListSourceProvider.class
PropertyComparator.class
RefreshablePagedListHolder.class
ResourceEditorRegistrar.class
SortDefinition.class

./org/springframework/context:
access
ApplicationContextAware.class
ApplicationContext.class
ApplicationContextException.class
ApplicationEvent.class
ApplicationEventPublisherAware.class
ApplicationEventPublisher.class
ApplicationListener.class
ConfigurableApplicationContext.class
event
HierarchicalMessageSource.class
i18n
Lifecycle.class
MessageSourceAware.class
MessageSource.class
MessageSourceResolvable.class
NoSuchMessageException.class
ResourceLoaderAware.class
support

./org/springframework/context/access:
ContextBeanFactoryReference.class
ContextJndiBeanFactoryLocator.class
ContextSingletonBeanFactoryLocator.class
DefaultLocatorFactory.class

./org/springframework/context/event:
AbstractApplicationEventMulticaster.class
ApplicationEventMulticaster.class
ConsoleListener.class
ContextClosedEvent.class
ContextRefreshedEvent.class
EventPublicationInterceptor.class
SimpleApplicationEventMulticaster$1.class
SimpleApplicationEventMulticaster.class
SourceFilteringListener.class

./org/springframework/context/i18n:
LocaleContext.class
LocaleContextHolder.class
SimpleLocaleContext.class

./org/springframework/context/support:
AbstractApplicationContext$1.class
AbstractApplicationContext$BeanPostProcessorChecker.class
AbstractApplicationContext.class
AbstractMessageSource.class
AbstractRefreshableApplicationContext.class
AbstractXmlApplicationContext.class
ApplicationContextAwareProcessor.class
ApplicationObjectSupport.class
ClassPathXmlApplicationContext.class
DefaultMessageSourceResolvable.class
DelegatingMessageSource.class
FileSystemXmlApplicationContext.class
GenericApplicationContext.class
MessageSourceAccessor.class
MessageSourceResourceBundle.class
ReloadableResourceBundleMessageSource.class
ReloadableResourceBundleMessageSource$PropertiesHolder.class
ResourceBundleMessageSource.class
ResourceMapFactoryBean.class
StaticApplicationContext.class
StaticMessageSource.class

./org/springframework/core:
annotation
AttributeAccessor.class
AttributeAccessorSupport.class
BridgeMethodResolver.class
CollectionFactory$BackportConcurrentCollectionFactory.class
CollectionFactory.class
CollectionFactory$CommonsCollectionFactory.class
CollectionFactory$JdkCollectionFactory.class
ConstantException.class
Constants.class
ControlFlow.class
ControlFlowFactory.class
ControlFlowFactory$Jdk13ControlFlow.class
ControlFlowFactory$Jdk14ControlFlow.class
Conventions.class
enums
ErrorCoded.class
GenericCollectionTypeResolver.class
io
JdkVersion.class
LocalVariableTableParameterNameDiscoverer.class
LocalVariableTableParameterNameDiscoverer$FindConstructorParameterNamesClassVisitor.class
LocalVariableTableParameterNameDiscoverer$FindMethodParameterNamesClassVisitor.class
LocalVariableTableParameterNameDiscoverer$LocalVariableTableVisitor.class
LocalVariableTableParameterNameDiscoverer$ParameterNameDiscoveringVisitor.class
MethodParameter.class
NestedCheckedException.class
NestedExceptionUtils.class
NestedIOException.class
NestedRuntimeException.class
OrderComparator.class
Ordered.class
OverridingClassLoader.class
ParameterNameDiscoverer.class
PrioritizedParameterNameDiscoverer.class
ReflectiveVisitorHelper$1.class
ReflectiveVisitorHelper.class
ReflectiveVisitorHelper$ClassVisitMethods$1.class
ReflectiveVisitorHelper$ClassVisitMethods.class
SpringVersion.class
style
task

./org/springframework/core/annotation:
AnnotationAwareOrderComparator.class
AnnotationUtils.class
Order.class

./org/springframework/core/enums:
AbstractCachingLabeledEnumResolver$1.class
AbstractCachingLabeledEnumResolver.class
AbstractGenericLabeledEnum.class
AbstractLabeledEnum.class
LabeledEnum$1.class
LabeledEnum$2.class
LabeledEnum.class
LabeledEnumResolver.class
LetterCodedLabeledEnum.class
ShortCodedLabeledEnum.class
StaticLabeledEnum.class
StaticLabeledEnumResolver.class
StringCodedLabeledEnum.class

./org/springframework/core/io:
AbstractResource.class
ByteArrayResource.class
ClassPathResource.class
DefaultResourceLoader.class
DescriptiveResource.class
FileSystemResource.class
FileSystemResourceLoader.class
InputStreamResource.class
InputStreamSource.class
Resource.class
ResourceEditor.class
ResourceLoader.class
support
UrlResource.class

./org/springframework/core/io/support:
EncodedResource.class
LocalizedResourceHelper.class
PathMatchingResourcePatternResolver.class
PropertiesLoaderSupport.class
PropertiesLoaderUtils.class
ResourceArrayPropertyEditor.class
ResourcePatternResolver.class
ResourcePatternUtils.class

./org/springframework/core/style:
DefaultToStringStyler.class
DefaultValueStyler.class
StylerUtils.class
ToStringCreator.class
ToStringStyler.class
ValueStyler.class

./org/springframework/core/task:
AsyncTaskExecutor.class
SimpleAsyncTaskExecutor$1.class
SimpleAsyncTaskExecutor.class
SimpleAsyncTaskExecutor$ConcurrencyThrottleAdapter.class
SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.class
SyncTaskExecutor.class
TaskExecutor.class
TaskRejectedException.class
TaskTimeoutException.class

./org/springframework/util:
AntPathMatcher.class
Assert.class
AutoPopulatingList.class
AutoPopulatingList$ElementFactory.class
AutoPopulatingList$ElementInstantiationException.class
AutoPopulatingList$ReflectiveElementFactory.class
CachingMapDecorator.class
ClassLoaderUtils.class
ClassUtils.class
CollectionUtils.class
comparator
ConcurrencyThrottleSupport.class
CustomizableThreadCreator.class
DefaultPropertiesPersister.class
FileCopyUtils.class
Log4jConfigurer.class
MethodInvoker.class
NumberUtils.class
ObjectUtils.class
PathMatcher.class
PatternMatchUtils.class
PropertiesPersister.class
ReflectionUtils$1.class
ReflectionUtils$2.class
ReflectionUtils$3.class
ReflectionUtils.class
ReflectionUtils$FieldCallback.class
ReflectionUtils$FieldFilter.class
ReflectionUtils$MethodCallback.class
ReflectionUtils$MethodFilter.class
ResourceUtils.class
ResponseTimeMonitor.class
ResponseTimeMonitorImpl.class
StopWatch$1.class
StopWatch.class
StopWatch$TaskInfo.class
StringUtils.class
SystemPropertyUtils.class
TypeUtils.class
WeakReferenceMonitor$1.class
WeakReferenceMonitor.class
WeakReferenceMonitor$MonitoringProcess.class
WeakReferenceMonitor$ReleaseListener.class
xml

./org/springframework/util/comparator:
BooleanComparator.class
ComparableComparator.class
CompoundComparator.class
InvertibleComparator.class
NullSafeComparator.class

./org/springframework/util/xml:
DomUtils.class
SimpleSaxErrorHandler.class
SimpleTransformErrorListener.class
XmlValidationModeDetector.class

*/

 */可能可以再次简化,但是我没有继续进行,如果有兴趣可以继

分享到:
评论

相关推荐

    ws.rar_spring app_spring mybatis

    首先,Spring框架是Java企业级应用的核心,它提供了一个全面的编程和配置模型,可以简化开发并促进组件的重用。Spring的核心特性包括依赖注入(DI)和面向切面编程(AOP)。DI使得我们可以解耦组件,而AOP则允许我们...

    Spring5.1.4核心jar包,包括mvc,webmvc

    Spring框架是Java开发中最常用的轻量级框架之一,它的核心组件包括了IoC(Inversion of Control,控制反转)和AOP(Aspect Oriented Programming,面向切面编程)。Spring 5.1.4版本是该框架的一个稳定版本,提供了...

    JAVAspring-使用JavaSpring+JQuery开发的web天气APP.zip

    在服务层,Spring作为一个服务容器,可以管理bean的生命周期,提供事务管理,并允许开发者使用注解来简化配置。例如,@Service、@Repository和@Controller注解分别用于标记服务类、数据访问类和控制器类,而@...

    spring使用web socket

    对于前端,可以使用JavaScript库如sockjs-client和stompjs与Spring WebSocket服务器进行通信。这些库提供了方便的API来连接、发送和接收STOMP消息。 10. **调试和监控** 开发过程中,可以利用Spring提供的`...

    my spring mvc sample app

    在这个名为"my spring mvc sample app"的项目中,我们看到的是一个基础的Spring MVC应用实例,它能够成功运行并展示基本的功能。 Spring MVC的核心概念包括控制器(Controller)、模型(Model)、视图(View)和...

    my-app-spring-boot-starter.tar.gz

    在实际使用"my-app-spring-boot-starter"时,开发者可以通过在自己的项目中引入该Starter,从而获取其提供的服务和配置。这通常只需要在Maven或Gradle的依赖管理中添加对应的坐标,然后就可以利用Starter中的类和...

    spring配置WebSocket开发包

    如果你使用的是Spring Boot,可以通过添加`spring-boot-starter-websocket`依赖来简化配置。 2. **配置WebSocket端点**:创建一个带有`@ServerEndpoint`注解的类,如`WebSocketConfig.java`,并提供处理连接建立、...

    利用vscode创建的spring基础调试项目

    2. 使用VSCode配置Java和Spring Boot的开发环境。 3. 创建Spring Boot项目,包括主类、源代码目录结构以及pom.xml文件的配置。 4. 通过VSCode的Maven支持构建和运行Spring Boot项目。 5. 设置VSCode的launch.json...

    详解Spring中bean的scope以后使用

    正确理解和运用Bean的作用域对于优化应用程序性能、简化开发流程具有重要意义。本文将详细介绍Spring中不同作用域的Bean,包括它们的特点、应用场景以及配置方法。 #### 二、作用域概述 Spring框架提供了多种作用...

    eclipse整合spring插件

    6. **运行和调试**:使用Eclipse的内置服务器或者Tomcat等外部服务器,可以方便地运行和调试Spring应用。在项目上右键点击,选择"Run As" -&gt; "Spring Boot App"或"Debug As" -&gt; "Spring Boot App"。 7. **版本控制...

    采用SpringBoot+Spring+Spring mvc+mybatis实现Flutter微校园APP的服务端程序-源码

    本项目是基于Spring Boot、Spring、Spring MVC和MyBatis技术栈实现的Flutter微校园APP的服务端程序。这个服务端程序旨在为Flutter前端提供稳定、高效的数据接口,以支持校园生活的各种功能,如课程管理、成绩查询、...

    从0写一个问卷调查APP后端spring boot基础框架

    Spring Boot是Java领域中广泛使用的微服务开发框架,它简化了Spring应用的初始搭建以及开发过程。在构建一个问卷调查APP的后端时,我们需要利用Spring Boot的优势来搭建高效、稳定且易于维护的基础框架。以下将详细...

    spring-cglib-repack-3.2.6.jar和spring-objenesis-repack-2.6.jar

    Spring框架是Java开发中广泛应用的一个开源框架,它极大地简化了企业级应用的开发工作。在提供的文件中,我们看到了两个与Spring相关的库:`spring-cglib-repack-3.2.6.jar` 和 `spring-objenesis-repack-2.6.jar`。...

    配置 google app 配置 spring. 配置jdo

    7. **测试和部署**:在本地环境中运行和测试应用程序,确保所有配置正确无误后,使用GAE SDK的命令行工具或IDE插件将应用部署到Google App Engine。 这个过程涉及的技术深度和广度都相当大,涵盖了许多Java开发的...

    spring boot cli 1.5.10

    总的来说,Spring Boot CLI 1.5.10提供了一个强大的工具,它简化了Spring应用的开发流程,使得开发者能够更加聚焦于业务逻辑,而非繁琐的配置和构建过程。通过熟练使用CLI,可以显著提升开发效率,尤其是对于快速...

    Spring面试宝典 不看后悔

    - 用于简化事务管理,可以在类或方法级别使用。 - 示例代码中的`Customer` 类使用了`@Transactional` 注解,表明整个类的方法都具有事务管理特性。 #### 六、自动装配策略 - **`auto-wire` 属性** - 在XML配置...

    009 maven插件spring-boot-maven-plugin

    Spring Boot Maven Plugin 是一个 Maven 插件,用于简化 Spring Boot 项目的构建和打包过程。该插件提供了许多有用的功能,例如重新打包可执行的存档、自定义层配置、继承 Starter 父 POM 等。 插件概述 Spring ...

    JSF和Spring集成.doc

    **JSF (JavaServer Faces)** 和 **Spring** 都是目前广泛使用的Java Web开发框架。JSF 是一个用于构建基于 Java 的 Web 应用程序的标准组件框架,而 Spring 框架则是一个全面的轻量级应用程序框架,用于简化企业级...

    SSM框架开发APP软件管理平台包含MySQL数据库

    在这个APP软件管理平台上,Spring MVC处理了用户和管理员的各种交互,如登录、注册、查询和管理APP信息等。 再者,**MyBatis** 是一个持久层框架,它简化了数据库操作。MyBatis允许开发者编写SQL语句,并将这些SQL...

    Spring项目的xsd文件大全

    Spring框架是Java开发中广泛应用的一个开源项目,它以其强大的依赖注入、面向切面编程和模块化设计而闻名。...通过深入理解和使用这些文件,开发者能够更加高效地构建、管理和扩展他们的Spring应用。

Global site tag (gtag.js) - Google Analytics