Skip to content

Instantly share code, notes, and snippets.

@NeilAlishev
Created February 11, 2019 12:28
Show Gist options
  • Save NeilAlishev/a7be183f5c0d612cc6ebf287e129bed5 to your computer and use it in GitHub Desktop.
Save NeilAlishev/a7be183f5c0d612cc6ebf287e129bed5 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="testBean"
class="alishev.spring.demo.TestBean">
<constructor-arg value="Neil"/>
</bean>
</beans>
@AlinaKlishyna
Copy link

Если в вашем конструкторе несколько параметров:

<!-- id - уникальный идендитификатор нашего обьекта/бина -->
<!-- constructor-arg - передаем аргументы в конструктор -->
<bean id="testBean"
      class="com.gmail.alinakotova102.TestBean">
    <constructor-arg value="Alina"/>
    <constructor-arg value="Klishyna"/>
</bean>

@dmitry-grinko
Copy link

Спасибо

@Woody-rn
Copy link

Спасибо!

@gadgetfan
Copy link

Спасибо

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment