Spring Tutorial 08 - Inner Beans, Aliases and idref

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ส.ค. 2024

ความคิดเห็น • 86

  • @ginopeduto4264
    @ginopeduto4264 5 ปีที่แล้ว +20

    I am really impressed! These videos are high quality in every aspekt - good didactics, clear accentfree voice, pleasant degree of difficulty, to name a few. Thx a lot!!!

  • @michaelkarnerfors9545
    @michaelkarnerfors9545 8 ปีที่แล้ว +39

    In spring 4.2, the following is needed for bean references:

    • @Waldi_WK
      @Waldi_WK 7 ปีที่แล้ว +5

      It will not work, because is not at all the same as . It is the same as .

  • @amimehta7755
    @amimehta7755 9 ปีที่แล้ว +8

    The whole spring tutorial from 1 to 24 is absolutely amazing.I have been working on spring projects without any reading. Could clear interviews due o lack of technical terms. As i have worked already now can relate to all that absolutely clear.Its a very simplified to the point tutorial

  • @sudhirphapale762
    @sudhirphapale762 8 ปีที่แล้ว +16

    Hi yes,
    With all Respect to Java Brains
    idRef concept is wrongly explained. Even the tag is wrong.
    Actual tag is
    when you use it in some example say as below :




    then it is same as

    so instead of reference to bean it actually returns string "bean name" which happens to be "point" in above example.

    • @hetalgada8293
      @hetalgada8293 6 ปีที่แล้ว

      Yes. You are right. The tag is used to create a String-typed value equal to the ID of the referred bean and is intended for validation purposes

    • @kzanonymscatalyst2196
      @kzanonymscatalyst2196 6 ปีที่แล้ว

      I think idref part was not executed and no demo was shown...

  • @pemasherpa6637
    @pemasherpa6637 4 ปีที่แล้ว +1

    You have very good teaching techniques. Thank you for your efforts. Please create small projects that helps us in real world work environment.

  • @adityanehra
    @adityanehra 7 ปีที่แล้ว +1

    Believe me ... one day u will rise to power!!!!!

  • @sanjay_nk
    @sanjay_nk 11 ปีที่แล้ว +1

    wow, best tutorial available !! Thanks man ..these tutorials are really very easy to grasp the concept :)

  • @mrnuke1
    @mrnuke1 10 ปีที่แล้ว +1

    this is a great tutorial! Thanks for all the work u've done!

  • @AmarSonwani
    @AmarSonwani 7 ปีที่แล้ว

    Good Videos.. The way you speak is good. Sounds processional.

  • @hexaaaaa
    @hexaaaaa 8 ปีที่แล้ว

    Neat! Thank you for these series. You're the best.

  • @sanketskhandekar
    @sanketskhandekar 10 ปีที่แล้ว

    Koushik your tutorial are always best i just want to add on idref just need to correct idref is only working with respect to string value
    this is spring doc
    The idref element is simply an error-proof way to pass the id (string value - not a reference) of another bean in the container to a or element.

  • @pankajpetkar3772
    @pankajpetkar3772 7 ปีที่แล้ว +15

    idref concept is wrongly explained in this tutorial

  • @MukulTripathi
    @MukulTripathi 13 ปีที่แล้ว

    Was waiting for it from a long time! Thanks!

  • @devendrareddy1155
    @devendrareddy1155 9 ปีที่แล้ว +1

    very good explanation..Thank you very much sir..

  • @jayadrathisangry
    @jayadrathisangry 11 ปีที่แล้ว

    Thank you for that.It was baffling me until I saw your comment.

  • @eliastefera8574
    @eliastefera8574 8 ปีที่แล้ว

    using local instead of bean attribute is the preferred one as per the API documentation. In this example:

    • @ashwani1112
      @ashwani1112 7 ปีที่แล้ว

      Not worked this as well, is there any other ways?

  • @burakyigit1446
    @burakyigit1446 7 ปีที่แล้ว

    If you give an unexisting bean id to idref bean prop, container throws BeanDefinitionStoreException. If the bean exists, at this time it throws ConversionNotSupported and BeanCreationException. The purpose of the idref usage is to check if it exists or unexists, i think.

  • @worldofkhyati
    @worldofkhyati 8 ปีที่แล้ว +1

    nice explination ....thank you.........

  • @parthsalat3915
    @parthsalat3915 2 ปีที่แล้ว +1

    Which state (of India) are you from? And where are you currently staying?
    No, nothing personal, just curious...

  • @ashu2103
    @ashu2103 4 ปีที่แล้ว +3

    The last one "idref" should be:

  • @sudhirphapale762
    @sudhirphapale762 8 ปีที่แล้ว

    Great Videos Java Brains...

  • @ShaunMcCready
    @ShaunMcCready 11 ปีที่แล้ว +1

    I tried this tutorial and the line idref that he used didnt work for me. Yet swapping out idref for ref but adding bean=point3 works. Even trying idref bean="point3" doesnt work. Do you know why this is the case? Wondering perhaps this is based off an older ver of the API?

  • @yuvabasavoju
    @yuvabasavoju ปีที่แล้ว

    The concept of "idref" is incorrect & facing issues with execution. Please correct the same in the tutorial

  • @suchethanm7282
    @suchethanm7282 5 หลายเดือนก่อน

    How to learn the same concepts in spring boot

  • @aryansh004
    @aryansh004 11 ปีที่แล้ว

    For me (idref bean="zeroPoint")(/idref) too didn't work. But the syntax that VenkatLaks suggested solved the issue finally. I think it depends on the eclipse version we are using. That's why it worked for Koushik in the video and not for us. M using Eclipse Juno.

  • @cachwahed
    @cachwahed 12 ปีที่แล้ว

    @NullPointerDude
    that's right, but it doesn't fixed neither with local="zeroPoint"
    still have Exception: Element type "idref" must be followed by either attribute specifications, ">" or "/>".

  • @James5Sapphire
    @James5Sapphire 5 ปีที่แล้ว

    When the first time you assign an alias to the bean triangle, you currently have not assigned any name to it previously . So how does the XML associate the Name = " triangle" with the bean id = "triangle" ? ?? does it consider both of them to be the same ? i .e, name and id of triangle ?

    • @deyjishnu
      @deyjishnu 5 ปีที่แล้ว

      Yes, I think so

  • @adarshverma3372
    @adarshverma3372 3 ปีที่แล้ว

    as the

    will give an exception because the idref checks for String euqalization not the Point Object with some other bean with the id="zeroBean"
    but here we are having the Point object instead of the string that's why it will return the java.lang.IllegalStateException and no matching editors or conversion strategy found
    because as it is assigning the string value but we are using the Point object bean

  • @KentOJohnson
    @KentOJohnson 11 ปีที่แล้ว

    It worked for me in the first time. I am using Eclipse Juno
    Version: Juno Service Release 2
    You probably typed something in wrong.

  • @0x28
    @0x28 12 ปีที่แล้ว +2

    @cachwahed Hey guys, I am following this video as well and I fixed this 'conversion' error by doing half an hour of intensive research. lol. Anyway here is the fix:
    (property name="pointA")
    (ref local="zeroPoint"/)
    (/property)
    The reason for this is that idref is to refer to a bean as a String value (hence cannot convert String to Object).
    One must use (ref local="myBean"/) instead of (idref). Why? I don't know, but what I read on here:

  • @zgillet
    @zgillet 11 ปีที่แล้ว +6

    I hope you realize your "triangle" in these examples is actually a line. The y-coordinate is always 0.

  • @JoshuaMcQueen
    @JoshuaMcQueen 13 ปีที่แล้ว

    I encountered one error in this video. At the very end, eclipse did not like the idref syntax .
    I had to modify the line for it to work:
    (idref bean="zeroPoint")(/idref)
    Note: had to give the tags parentheses so youtube would accept the comment

  • @badrufun
    @badrufun 5 ปีที่แล้ว

    How can we initialize the bean using constructor of our own choice in xml? I mean if we have three constructor then how can we use 1st constructor for initializing first bean 2nd constructor for initializing 2nd bean and so on?

    • @mawirab5930
      @mawirab5930 5 ปีที่แล้ว

      depends on the number of args in the constructors and types... you can use index from video 6 i believe

  • @TheGuroguro12
    @TheGuroguro12 7 ปีที่แล้ว

    Thank you very much.

  • @amanvikram04
    @amanvikram04 7 ปีที่แล้ว +1

    my idref is not working..could you please help me on this

    • @futurestar1000
      @futurestar1000 7 ปีที่แล้ว

      use it as

    • @ashwani1112
      @ashwani1112 7 ปีที่แล้ว +1

      Not working with
      anything else need to be defined?

  • @saikumarm7609
    @saikumarm7609 6 ปีที่แล้ว

    hi koushik,
    please revisit idref and ref tag usage. In my case, idref does not work. spring complains with the below error.
    But if I replace tag with everything works fine.
    ----------------------------------------------------------------------------------
    Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.koushik.javabrains.Point' for property 'pointA'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'org.koushik.javabrains.Point' for property 'pointA': no matching editors or conversion strategy found
    ----------------------------------------------------------------------------------

  • @harsh1003able
    @harsh1003able 4 ปีที่แล้ว

    Not explained inner beans with different scopes

  • @rajput_manoj
    @rajput_manoj 6 ปีที่แล้ว

    Thanks Sir...

  • @mansukhdeep
    @mansukhdeep 7 ปีที่แล้ว +1

    idref wrongly explained. It is a means to pass a String value not a reference to another bean.

    • @ashwani1112
      @ashwani1112 7 ปีที่แล้ว

      @Mansukhdeep, could you please assist the correct tag for , I read many article but didn't get understand.

  • @parthpatel00
    @parthpatel00 3 ปีที่แล้ว

    I thought classes of beans were singleton!

  • @danielrawat8930
    @danielrawat8930 11 ปีที่แล้ว +2

    Please create your free videos for learning purpose if you really has good knowledge...if not stop criticizing people who are really helping people providing such learning topics.

  • @AjayKumar-fd9mv
    @AjayKumar-fd9mv 3 ปีที่แล้ว

    👍

  • @prakashgourav
    @prakashgourav 8 ปีที่แล้ว +1

    Your understanding of the idref tag is COMPLETELY WRONG. Check out the spring documentation.

  • @moofymoo
    @moofymoo 7 ปีที่แล้ว

    ..or just avoid aliases.

  • @michaelrobb9542
    @michaelrobb9542 11 ปีที่แล้ว +5

    Anyone else think its funny that his triangle in a line?

    • @adilmuthukoya2272
      @adilmuthukoya2272 5 ปีที่แล้ว +3

      I felt the same .... but thats not what we are emphasizing here .. so its not fair to say that

  • @gauravsingh-nt2bs
    @gauravsingh-nt2bs 11 ปีที่แล้ว

    owner is surely not explaining trigonometry so it doesn't matter

  • @yp89
    @yp89 9 ปีที่แล้ว +2

    idref problem is getting bigger..anybody?

    • @subashm3886
      @subashm3886 8 ปีที่แล้ว

      +Prashanth YP
      Check the docs
      docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/beans.html#beans-idref-element
      It is an foolproof way to send only String value & not reference. Java Brains understanding was wrong. It accepts name & id of a bean.

      The above bean definition snippet is exactly equivalent (at runtime) to the following snippet:
      The first form is preferable to the second, because using the idref tag allows the container to validate at deployment time that the referenced, named bean actually exists.

  • @ihardikb
    @ihardikb 5 ปีที่แล้ว

    Actually its a Line !! ;p

  • @rarra
    @rarra 11 ปีที่แล้ว

    No it's just you.

  • @puneethshivalingaiah
    @puneethshivalingaiah 9 ปีที่แล้ว +2

    :)

  • @pridhyudevsm3622
    @pridhyudevsm3622 ปีที่แล้ว

    Bro, Actually the three points are collinear, a triangle cannot exist!!!🤣🤣🤣

  • @TravelWorld1
    @TravelWorld1 10 ปีที่แล้ว

    SJC Cadet Patoon 1983

  • @xingcebao5379
    @xingcebao5379 4 ปีที่แล้ว

    idref is wrongly explained I think

    • @xingcebao5379
      @xingcebao5379 4 ปีที่แล้ว

      I am pretty sure that the idref is wrongly explained, the correct explanation here stackoverflow.com/questions/14607142/spring-idref-usage

  • @sudhirphapale762
    @sudhirphapale762 8 ปีที่แล้ว +4

    Hi yes,
    With all Respect to Java Brains
    idRef concept is wrongly explained. Even the tag is wrong.
    Actual tag is
    when you use it in some example say as below :




    then it is same as
    so instead of reference to bean it actually returns string "bean name" which happens to be "point" in above example.