English 中文(简体)
关于春季3框架的一组问题
原标题:A bunch of questions on Spring 3 framework

这里的问题来自阅读《春季参考书》,请提供帮助。

(1) 我是否需要手工制作申请目录? 我是否需要第二例重复读物?

(2) 我们有以下命令:

<context:annotation-config/> 
<context:component-scan base-package=".."/> 
<mvc:annotation-driven/>

这些指示是否与自己重复? 在哪些情况下是,没有?

(3) I am a bit stuck with all that ways Spring introduces to convert from string to object: PropertyEditor, Conversions, Formatting.. Here is a simple use case: I have a Spring MVC controller that processes some POST request. That request is a result of filling some form. The form is a web representation of some entity. So, given a the user submits a new Project form. In that form exist a date field and a manager s name field to be selected from the list of existing managers. The entered date should be converted to Date property of Project object, and manager s name - to Manager property, created or located by this name (i.e. I want to inject Manager into his Project). What should I use in this case? Property editors, formatters, something else?

(4) Generally, may I say that all the @interface classes that are found on classpath can be used by Spring as annotations? In other words, how can I know which annotations can be used in my project? All that can be found in my classpath, or I need to register them somehow?

(5) I tried to use spring aop without aspectj.jar: just created an Aspect and addred XML definition for this aspect (without any annotations). As a result it throws "class not found Exception: org/aspectj/weaver/BCException". So looks like I cannot use Spring AOP without aspectJ library?

最佳回答

(1) 我是否需要手工制作申请目录? 我是否需要第二例重复读物?

春天一般在两个环境中——网络开发和桌面应用程序/备用服务器。 在前一种情况下,ApplicationContext 自动通过ContextLoaderListener <>/code><>a>。 http://static.childrensource.org/children/docs/present/javadoc-api/org/childrenframework/web/WebApplicationInitializer.html“rel=“noretinger”>

在后一种情况下(单独申请),你负责创建并销毁<>/em>申请环境。


(2) 我们有以下命令:

<代码><context:component-scan base- Package= >>提供<的所有功能;context:annotation-config/> + (surprise!) content scanning. <mvc:annotation-led/> is arbitrary independent and it recognized


[......]我能知道在我的项目中可以使用哪些说明? [......]

我发现此点:,一段时间前(我不是作者)。 它将告诉你,在什么时候能够说明。


我的班子里可以找到的。

rel=“noreferer”>@Inject<> ,如果在CLCSATH上找到,其他说明需要人工编制,见上文。


所以,我看不懂,我无法在没有方面利用J图书馆的情况下使用春阿普。

You can use Spring without CGLIB if you only use interface proxies (i.e. you only apply aspects on classes implementing at least one interface). Otherwise you need CGLIB to dynamically create subclasses.

问题回答

暂无回答




相关问题
array dependency injection in spring?

is there a way to use dependency injection to inject all available implementations of a specific interface in spring? This is kind of the same thing as asked here for .NET. Though my aim is to use @...

Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Grails Packaging and Naming Conventions

Packaging Controllers, Services,etc. i.e. - com.company.controllers - com.company.services Is this a good practice or should be avoided by all means?? Another worth mentioning problem I encountered ...

How can I determine Objects in application context?

I am trying to write a portlet for Liferay (using Tomcat and Spring) and need to use a database via Persistence API/Hibernate. I am using some configuration XMLs (applicationContext.xml, etc.) and ...

How to prevent JPA from rolling back transaction?

Methods invoked: 1. Struts Action 2. Service class method (annotated by @Transactional) 3. Xfire webservice call Everything including struts (DelegatingActionProxy) and transactions is configured ...