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 8939707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:52:35+00:00 2026-06-15T10:52:35+00:00

This is my eventAction ActionSupport Class public class EventAction extends ActionSupport { protected EventService

  • 0

This is my eventAction ActionSupport Class

public class EventAction extends ActionSupport {

    protected EventService eventService;

    protected String redirectUrl;

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    public void setEventService(EventService services) {
        this.eventService = services;
    }
}

And here is a fragment from my applicationContext.xml

<bean id ="eventService" class ="services.EventService" scope ="singleton">
        <property name = "sessionFactory" ref = "sessionFactory"/>
    </bean>

The code is working fine except for when I change the id inside the declartion.

My question why does spring <bean id ="eventService"> id has to be matched with eventService instance variable inside EventAction support class? isn’t id is just making an identifier for the bean that is going to be created? why should the id inside the bean tag should be the same inside my EventAction, where the EventAction class is not even being mentioned in the configruation?

  • 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-15T10:52:36+00:00Added an answer on June 15, 2026 at 10:52 am

    From Spring docs beans-beanname

    Every bean has one or more ids (also called identifiers, or names; these terms refer to the same thing). These ids must be unique within the container the bean is hosted in. A bean will almost always have only one id, but if a bean has more than one id, the extra ones can essentially be considered aliases.
    When using XML-based configuration metadata, you use the ‘id’ or ‘name’ attributes to specify the bean identifier(s). The ‘id’ attribute allows you to specify exactly one id, and as it is a real XML element ID attribute, the XML parser is able to do some extra validation when other elements reference the id; as such, it is the preferred way to specify a bean id. However, the XML specification does limit the characters which are legal in XML IDs. This is usually not a constraint, but if you have a need to use one of these special XML characters, or want to introduce other aliases to the bean, you may also or instead specify one or more bean ids, separated by a comma (,), semicolon (;), or whitespace in the ‘name’ attribute.

    I believe for Spring-Struts2 you are using the plugin where you need to either define auto-wire strategy or plugin will use default one which is name.

    That means when plugin bridge between Struts2 and Spring it will try to inject beans based on the supplied auto-wire strategy

    Refer to Struts2 Spring-plugin

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

Sidebar

Related Questions

This compiles: public interface IMyInterface { event Action<dynamic> OnSomeEvent; } class MyInterface : IMyInterface
Is it possible to use Enum in Android like this? public enum EventAction {
This is my code: <CheckBox android:id=@+id/sprint_checkbox android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/sprint_game /> <CheckBox android:id=@+id/marathon_checkbox android:layout_width=fill_parent android:layout_height=wrap_content
This works. $(document).ready(function(){ $(.items article).click(function(){ window.location=$(this).find(a).attr(href); return false; }); }); However , when the
this works public event Func<int,int> createEvents; but why not this ? public event Action<int>
I see this line in many online examples of using the Action delegate: public
I am creating and appending images (divs) like this: $('#event_list_main').append('<img class=listed_event id=random_event src=final_tutorial_buttons/random.png height=50
abstract class A<T> where T:A<T> { public event Action<T> Event1; } class B :
This one is a long one, bellow is my primary class that holds the
class a { public event Action foo; var zzz = new b(); foo +=

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.