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

  • SEARCH
  • Home
  • 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 8412177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:36:34+00:00 2026-06-10T00:36:34+00:00

I have following simple page: public class Login extends BasePage { private UserDao userDao;

  • 0

I have following simple page:

public class Login extends BasePage {
    private UserDao userDao;

    @Inject
    public void setUserDao(UserDao userDao) {
        System.out.println("setUserDao");
        this.userDao = userDao;
    }

Guice initialized with following code in Application:

@Override
protected void init() {
    Module myBatisModule = new XMLMyBatisModule() {
        @Override
        protected void initialize() {
        }
    };

    IbdGuiceModule ibdGuiceModule = new IbdGuiceModule();

    getComponentInstantiationListeners().add(new GuiceComponentInjector(this, myBatisModule, ibdGuiceModule));
}

Setter injection doesn’t work. setUserDao method is never called and userDao is null.

If I move @Inject annotation to the field, this works (setUserDao still not called but field value is initialized).

How to use setter injection?

  • 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-10T00:36:35+00:00Added an answer on June 10, 2026 at 12:36 am

    Wicket supports only field injection.
    Search in Google “Method injection considered harmful” for details.

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

Sidebar

Related Questions

I have a simple FAQ page in which each item has the following HTML
I have a very simple html page with the following javascript in it $(function()
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I have the following simple class definition: //mycommon.h @interface CurrentPath : NSObject @property (nonatomic,
Say you have the following object: public class Address { public String Line1 {
I have following simple code: <%@ Page Language=C# AutoEventWireup=true CodeBehind=testForm.aspx.cs Inherits=Orbs.testForm %> <html> <body>
I have the following web service: [ScriptService] public class Handler : WebService { [WebMethod]
Following up for my workmate I have the following class: public Pages { primary_key
I have the following simple structure: Applicant Possition ApplicantPosition and ApplicantPositionHistory The 3rd class
If i have the following strongly-typed view: <%@ Page Title= Language=C# MasterPageFile=~/Views/Shared/Site.Master Inherits=System.Web.Mvc.ViewPage<XXX.DomainModel.Core.Locations.Location> %>

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.