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

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript