How to convert an xml config bean to java annotation bean ( spring boot )Rest Template - XML IndentationHow do I efficiently iterate over each entry in a Java Map?How do I call one constructor from another in Java?How do I read / convert an InputStream into a String in Java?How do I generate random integers within a specific range in Java?How do I determine whether an array contains a particular value in Java?How do you parse and process HTML/XML in PHP?Which @NotNull Java annotation should I use?How do I convert a String to an int in Java?What's the difference between @Component, @Repository & @Service annotations in Spring?Java config for spring interceptor where interceptor is using autowired spring beans

What is the job of the acoustic cavities inside the main combustion chamber?

Is there any word for "disobedience to God"?

C program to parse source code of another language

How do you glue a text to a point?

Why are all my yellow 2V/20mA LEDs burning out with 330k Ohm resistor?

Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?

How to memorize multiple pieces?

Storming Area 51

Are unclear "take-it or leave-it" contracts interpreted in my favor?

Why were Er and Onan punished if they were under 20?

Why do players in the past play much longer tournaments than today's top players?

Managing and organizing the massively increased number of classes after switching to SOLID?

What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?

Professor falsely accusing me of cheating in a class he does not teach, 2 months after end of the class. What precautions should I take?

Why isn't pressure filtration popular compared to vacuum filtration?

What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?

Why isn't there research to build a standard lunar, or Martian mobility platform?

How to convert a file with several spaces into a tab-delimited file?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?

Why weren't bootable game disks ever common on the IBM PC?

Are neural networks prone to catastrophic forgetting?

Would dual wielding daggers be a viable choice for a covert bodyguard?

Why are they 'nude photos'?

Changing trains in the Netherlands



How to convert an xml config bean to java annotation bean ( spring boot )


Rest Template - XML IndentationHow do I efficiently iterate over each entry in a Java Map?How do I call one constructor from another in Java?How do I read / convert an InputStream into a String in Java?How do I generate random integers within a specific range in Java?How do I determine whether an array contains a particular value in Java?How do you parse and process HTML/XML in PHP?Which @NotNull Java annotation should I use?How do I convert a String to an int in Java?What's the difference between @Component, @Repository & @Service annotations in Spring?Java config for spring interceptor where interceptor is using autowired spring beans






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am new to java AOP. I am supposed to convert the following xml config to java annotation config in my spring boot application. May I know how exactly to convert this xml config to java annotation config:



I think none of the examples that I saw in stackoverflow match the pattern I am trying to convert.



 <bean id="xyzRestTemplate" 
class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="xyzClientHttpRequestFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<property name="marshaller" ref="jaxbDataMarshaller" />
<property name="unmarshaller" ref="jaxbDataMarshaller" />
</bean>
</list>
</property>
<property name="interceptors">
<list>
<bean class="com.example.XYZHeaderRequestInterceptor" />
</list>
</property>
</bean>
<bean id="jaxbDataMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPaths">
<list>
<value>com.a.b.c.d.v2</value>
</list>
</property> </bean>









share|improve this question






















  • Step 1 for getting help: Format that XML for human readability, i.e. indent it appropriately.

    – Andreas
    Mar 26 at 3:20

















0















I am new to java AOP. I am supposed to convert the following xml config to java annotation config in my spring boot application. May I know how exactly to convert this xml config to java annotation config:



I think none of the examples that I saw in stackoverflow match the pattern I am trying to convert.



 <bean id="xyzRestTemplate" 
class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="xyzClientHttpRequestFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<property name="marshaller" ref="jaxbDataMarshaller" />
<property name="unmarshaller" ref="jaxbDataMarshaller" />
</bean>
</list>
</property>
<property name="interceptors">
<list>
<bean class="com.example.XYZHeaderRequestInterceptor" />
</list>
</property>
</bean>
<bean id="jaxbDataMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPaths">
<list>
<value>com.a.b.c.d.v2</value>
</list>
</property> </bean>









share|improve this question






















  • Step 1 for getting help: Format that XML for human readability, i.e. indent it appropriately.

    – Andreas
    Mar 26 at 3:20













0












0








0








I am new to java AOP. I am supposed to convert the following xml config to java annotation config in my spring boot application. May I know how exactly to convert this xml config to java annotation config:



I think none of the examples that I saw in stackoverflow match the pattern I am trying to convert.



 <bean id="xyzRestTemplate" 
class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="xyzClientHttpRequestFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<property name="marshaller" ref="jaxbDataMarshaller" />
<property name="unmarshaller" ref="jaxbDataMarshaller" />
</bean>
</list>
</property>
<property name="interceptors">
<list>
<bean class="com.example.XYZHeaderRequestInterceptor" />
</list>
</property>
</bean>
<bean id="jaxbDataMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPaths">
<list>
<value>com.a.b.c.d.v2</value>
</list>
</property> </bean>









share|improve this question














I am new to java AOP. I am supposed to convert the following xml config to java annotation config in my spring boot application. May I know how exactly to convert this xml config to java annotation config:



I think none of the examples that I saw in stackoverflow match the pattern I am trying to convert.



 <bean id="xyzRestTemplate" 
class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="xyzClientHttpRequestFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<property name="marshaller" ref="jaxbDataMarshaller" />
<property name="unmarshaller" ref="jaxbDataMarshaller" />
</bean>
</list>
</property>
<property name="interceptors">
<list>
<bean class="com.example.XYZHeaderRequestInterceptor" />
</list>
</property>
</bean>
<bean id="jaxbDataMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPaths">
<list>
<value>com.a.b.c.d.v2</value>
</list>
</property> </bean>






java xml spring annotations






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 2:32









parushaparusha

141 bronze badge




141 bronze badge












  • Step 1 for getting help: Format that XML for human readability, i.e. indent it appropriately.

    – Andreas
    Mar 26 at 3:20

















  • Step 1 for getting help: Format that XML for human readability, i.e. indent it appropriately.

    – Andreas
    Mar 26 at 3:20
















Step 1 for getting help: Format that XML for human readability, i.e. indent it appropriately.

– Andreas
Mar 26 at 3:20





Step 1 for getting help: Format that XML for human readability, i.e. indent it appropriately.

– Andreas
Mar 26 at 3:20












1 Answer
1






active

oldest

votes


















0














When people talk about converting from XML they don't mean necessarily doing the same thing exactly. What makes Spring Boot attractive isn't just that a configuration is a java class.



You should convert this to use RestTemplate https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-resttemplate.html



Then you just build the RestTemplate using the builder to have the JaxB marshaller and the interceptor you want.



Rest Template - XML Indentation



A nice testcase that passes with XML and passes with @Configuration classes will prove you got it right.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349038%2fhow-to-convert-an-xml-config-bean-to-java-annotation-bean-spring-boot%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    When people talk about converting from XML they don't mean necessarily doing the same thing exactly. What makes Spring Boot attractive isn't just that a configuration is a java class.



    You should convert this to use RestTemplate https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-resttemplate.html



    Then you just build the RestTemplate using the builder to have the JaxB marshaller and the interceptor you want.



    Rest Template - XML Indentation



    A nice testcase that passes with XML and passes with @Configuration classes will prove you got it right.






    share|improve this answer



























      0














      When people talk about converting from XML they don't mean necessarily doing the same thing exactly. What makes Spring Boot attractive isn't just that a configuration is a java class.



      You should convert this to use RestTemplate https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-resttemplate.html



      Then you just build the RestTemplate using the builder to have the JaxB marshaller and the interceptor you want.



      Rest Template - XML Indentation



      A nice testcase that passes with XML and passes with @Configuration classes will prove you got it right.






      share|improve this answer

























        0












        0








        0







        When people talk about converting from XML they don't mean necessarily doing the same thing exactly. What makes Spring Boot attractive isn't just that a configuration is a java class.



        You should convert this to use RestTemplate https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-resttemplate.html



        Then you just build the RestTemplate using the builder to have the JaxB marshaller and the interceptor you want.



        Rest Template - XML Indentation



        A nice testcase that passes with XML and passes with @Configuration classes will prove you got it right.






        share|improve this answer













        When people talk about converting from XML they don't mean necessarily doing the same thing exactly. What makes Spring Boot attractive isn't just that a configuration is a java class.



        You should convert this to use RestTemplate https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-resttemplate.html



        Then you just build the RestTemplate using the builder to have the JaxB marshaller and the interceptor you want.



        Rest Template - XML Indentation



        A nice testcase that passes with XML and passes with @Configuration classes will prove you got it right.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 26 at 2:48









        DerekDerek

        462 bronze badges




        462 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349038%2fhow-to-convert-an-xml-config-bean-to-java-annotation-bean-spring-boot%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현