Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:45:06+00:00 2026-06-03T21:45:06+00:00

Here are the questions resulted from reading the Spring Reference, please help. (1) Do

  • 0

Here are the questions resulted from reading the Spring Reference, please help.

(1) Do I ever need manual creation of ApplicationContext? Do I ever need second instance of AplicationContext?

(2) We have the following config instructions:

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

Do these instructions duplicate theirselfs? In which cases yes, in which no?

(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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:45:07+00:00Added an answer on June 3, 2026 at 9:45 pm

    (1) Do I ever need manual creation of ApplicationContext? Do I ever need second instance of AplicationContext?

    Spring is typically usd in two environments – in web development and in desktop applications/standalone servers. In the former case the ApplicationContext is created automatically via ContextLoaderListener defined in web.xml or WebContextInitializer in Servlet 3.0 container.

    In the latter case (standalone application) you are responsible for creating and destroying the application context.


    (2) We have the following config instructions:

    <context:component-scan base-package=".."/> provides all the functionality of <context:annotation-config/> plus (surprise!) component scanning. <mvc:annotation-driven/> is completely independent and it recognizes spring-mvc annotations like @Controller.


    […]The entered date should be converted to Date property of Project object[…]

    Register custom editor within @Controller:

    @Controller
    public class FooController {
        @InitBinder
        public void binder(WebDataBinder binder) {
            binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
                public void setAsText(String value) {
                    try {
                        setValue(new SimpleDateFormat("yy-MM-dd HH:mm:ss").parse(value));
                    } catch (ParseException e) {
                        setValue(null);
                    }
                }
            });
        }
    }
    

    […]how can I know which annotations can be used in my project?[…]

    I found this awesome annotations support sheet some time ago (I am not an author). It will tell you which annotations are enabled when.


    All that can be found in my classpath

    @Inject is enabled if it is found on the CLASSPATH, other annotations need to be enabled manually, see above.


    So looks like I cannot use Spring AOP without aspectJ library?

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading some questions here on SO about conversion operators and constructors got me thinking
Reading through some of the questions here, the general concensus seems to be that
I've been reading here a few questions regarding the use of unit testing to
Reading the questions here and here has given me some insight into the situation,
I've seen questions here about moving the cursor from window to window with C-x
Ok 2 questions here. I am creating a c# application from a vb6 application.
Many questions here on SO ask about custom classes. I, on the other hand,
So two questions here: If I use <input type=button onclick=validate()> then the enter key
Continuing on previous questions ( here , and here ), I implemented a basic
I have found several other questions here on S.O. (and the web in general)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.