Additional configuration, is ready as follows: In a few classes projects order may sound useless though in a few dozens it can be very helpful. Fill in your details below or click an icon to log in: I believe that you got it and you are ready to build your app. Which means that we are ok!! We will do this in the properties of the maven file, the pom.
Uploader: | Samukus |
Date Added: | 1 January 2008 |
File Size: | 43.55 Mb |
Operating Systems: | Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X |
Downloads: | 92550 |
Price: | Free* [*Free Regsitration Required] |
You are commenting using your Google account. And we are ready to test our page. Our method will be:.
We will create a page which will output a message, taken from the controller. The 2 annotations are: The date in my machine is: There is already a sample page there the home. You may download it from here. The other is the datasource!!
The method setUp which is annotated as before will be called before the tests because of the annotation. HomeController — Welcome home! I will post in the next days a related post, as an extension to this.
SpringBoot:在spring官网上下载历史版本的spring插件STS压缩包
Do the same if you too wish to use the 3. Pretty much everything we need: Let us change the method a bit, so we add our own signature in the testing — and for some new of us to understand how this spring works — as follows:. The MainTests class should look like the following: Fill in your details below or click an icon to log in: GreetController — another handy thing is to use as suffix the actuall name of the component.
The first is testing and is the one that follows in the next paragraphs.
Our controller adds in model an attribute named halloMessage with the value Hallo Stranger! The following lines do that: In order to test web requests and verify proper running this is the way. Sorry, your blog cannot share posts by email.
I will not go into this. Next we create our hallo.
Which means that once it is called it returns as model attribute — request attribute — the time in your machine and afterwards it calls the home view, or the home page. Before doing anything else we need our appropriate dependencies. This is the approach to wpring the actual web request and not just the method in our controller.
In a few classes projects order may sound useless though in a few dozens it can be very helpful. So alter the MainTests as follows: I currently use the 2.9.2 version 2.
SpringBoot:在spring官网上下载历史版本的spring插件STS压缩包 - Java天堂
apring Which means that we are ok!! Of course you can test other classes or layers — e. You are commenting using your Twitter account. In order to make the spring understands that this class is a controller the only thing we need to add, is the annotation Stts on the class as follows: Now we create a class named com. If the previous is not working or you are not sure about the context-root of the app, right click your project in the package explorer and choose web project settings.
Комментариев нет:
Отправить комментарий