- First Constructor is called
- Then Spring Bean is initialized
Saturday, January 30, 2021
Spring Bean: Is autowired attribute initialised before constructor?
Maven to Spring Application.Properties - Profile
#server.port=8081
spring.profiles.active=@activatedProperties@
<profiles>
<!-- DEV Build -->
<profile>
<id>DEV1</id>
<properties>
<activatedProperties>DEV1</activatedProperties>
</properties>
</profile>
<!-- AZURE Build -->
<profile>
<id>QA</id>
<properties>
<activatedProperties>QA</activatedProperties>
</properties>
</profile>
@Service classes are being created twice when the application starts.
https://stackoverflow.com/questions/4333390/service-are-constructed-twice
Make the following changes
myapp-config.xml
<!-- Load everything except @Controllers --> <context:component-scan base-package="com.myapp"> <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan>
myapp-servlet.xml
<!-- Load @Controllers only --> <context:component-scan base-package="com.myapp" use-default-filters="false"> <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan>
CURL Headers Base64 Authorization
curl --location --request POST 'https://test.salesforce.com/services/oauth2/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Cookie: BrowserId=4jzphkElEeu76TsJSxG4Tw' \ --data-urlencode 'client_id='a2rtyoi.k9iosdgh.b6rbmnb' \ --data-urlencode 'client_secret=23987590772833' \ --data-urlencode 'grant_type=password' \ --data-urlencode 'username=foo@bar.com' \ --data-urlencode 'password=Red1$Apple'
curl --location --request GET 'http://10.102.13.101:8086' --header 'Authorization: Basic base64[username:Password]
curl --location --request GET 'http://AZ-CVS-LI-RE-02:8086' --header 'Authorization: Basic U2hlZXRhbFM6ZWYxNTE1NWY3YTJjOGNiZWIyYjM3N2Q0NmQ2ZWRkYzkzOTg3NjljYTlhMzUyOTkwZDFhYjI1MzcxNDAyNzJiYQ=='
Friday, January 29, 2021
Code Syntax Highlighter in Blogger
Use this website
https://tohtml.com - It generates HTML
https://codebeautify.org/alleditor - It just formats Code
http://hilite.me/ - It generates Line Number + Code Syntax Highlighter
Generate HTML code snippet and copy it in "HTML View" mode of Blogger
Thursday, January 28, 2021
Bean Create Dynamically in Spring with Params ?
package org.springframework.beans.factory.config; public interface BeanDefinition extends AttributeAccessor, BeanMetadataElement { String SCOPE_SINGLETON = ConfigurableBeanFactory.SCOPE_SINGLETON; String SCOPE_PROTOTYPE = ConfigurableBeanFactory.SCOPE_PROTOTYPE; }
Beans can be "prototype" - Bean generated afresh at each call
or It can be "singleton" - One Bean for all Calls
https://stackoverflow.com/questions/27809838/how-to-instantiate-spring-managed-beans-at-runtime
Azure - Pipeline - Add Approver for Stage
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass
-
https://www.baeldung.com/spring-properties-file-outside-jar https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-featu...
-
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass
-
The decision was made to block such external HTTP repositories by default https://stackoverflow.com/questions/66980047/maven-build-failure-d...