简体   繁体   English

Intellij 想法——Spring Bean 配置文件

[英]Intellij idea - Spring Bean Configuration File

Introduction: I have problem coz I'm green in Intellij Idea.简介:我有问题,因为我在 Intellij Idea 中是绿色的。 I started my jurney in spring framework but I found big stone for ant on my way also I have map only for eclipse tourists.我在 spring 框架中开始了我的旅程,但我在路上发现了蚂蚁的大石头,而且我也只有日食游客的地图。

Main problem: I like to create xml file (Spring Bean Configuration File).主要问题:我喜欢创建xml文件(Spring Bean Configuration File)。 But i dont know how.但我不知道如何。 I was trying install plugins like(From Intellij Idea repository): Unitils plugin, XML Bean Generator, IdeaSpring.我正在尝试安装插件(来自 Intellij Idea 存储库):Unitils 插件、XML Bean Generator、IdeaSpring。 But only what I get its errors.但只有我得到它的错误。

I saw guy which did it in eclipse and this was looking so amazing: http://screenshooter.net/101973359/ycqhwbh Now I dont know is realy Intellij Idea inteligent tool if dumb cant understead.我看到有人在 eclipse 中做到了,这看起来太神奇了: http ://screenshooter.net/101973359/ycqhwbh 现在我不知道是不是真的 Intellij Idea 智能工具,如果哑巴不能代替。

Can u guys also (if possible) give me some nice tips for future to be best programmer in the universe?你们也可以(如果可能的话)给我一些很好的提示,让我将来成为宇宙中最好的程序员吗? Or my eye missed some nice treads?或者我的眼睛错过了一些漂亮的踏板?

Enable Spring plugin in your project:在您的项目中启用 Spring 插件:

File-> Settings ->Plugins 

And check Spring plugins ( Spring Support , Spring MVC, etc).并检查 Spring 插件( Spring SupportSpring MVC,等)。

Then select directory you want to put your Spring configuration in, right click and select然后选择要放置 Spring 配置的目录,右键单击并选择

 New -> XML Configuration File -> Spring Config

Alternatively you can just do File-> New File and just create xml file and enter namespace definitions.或者,您可以执行File-> New File并创建 xml 文件并输入命名空间定义。 IDEA should recognize your project as Spring project and configure plugins itself... IDEA 应该将您的项目识别为 Spring 项目并自行配置插件...

Or, as Anvesh Vejandla mentioned, you can just create a new Spring project或者,正如 Anvesh Vejandla 提到的,您可以创建一个新的 Spring 项目

File->New->Project... Choose Spring, check "Create empty spring-config.xml" File->New->Project... 选择Spring,勾选“Create empty spring-config.xml” 在此处输入图片说明

在此处输入图片说明

add dependencies{spring core , spring context} at pox.xml from this web site https://mvnrepository.com/artifact/org.springframework/spring-context/5.3.1从这个网站https://mvnrepository.com/artifact/org.springframework/spring-context/5.3.1在 pox.xml 添加依赖项{spring core , spring context}

Then select directory you want to put your Spring configuration in, right click and select然后选择要放置 Spring 配置的目录,右键单击并选择

New -> XML Configuration File -> Spring Config新建 -> XML 配置文件 -> Spring 配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM