Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website 😊
Still working on it 😊
Download Telegram
The @Qualifier annotation in Spring is used to differentiate a bean among the same type of bean objects.

If we have more than one bean of the same type and want to wire only one of them then use the @Qualifier annotation along with @Autowired to specify which exact bean will be wired.

If we don't use this annotation in the given project then we get an error like:

Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type
This media is not supported in your browser
VIEW IN TELEGRAM
👏1
The @Required annotation applies to bean property setter methods and it indicates that the affected bean property must be populated in XML configuration file at configuration time. Otherwise, the container throws a BeanInitializationException exception
public class Student {
private Integer age;
private String name;

@Required
public void setAge(Integer age) {
this.age = age;
}
public Integer getAge() {
return age;
}

@Required
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
import org.springframework.context.annotation.*;

@Configuration
public class HelloWorldConfig {
@Bean
public HelloWorld helloWorld(){
return new HelloWorld();
}
}
<!DOCTYPE html>
<html>
<head>

</head>
<body>
<script>
let obj1=[{prectype:"none",timepoint:3,cloudcover:9,seeing:6,transparency:3,liftedindex:2,rhm2:6,wind10m:"direction",speed:2,temp2m:27},
{prectype:"none",timepoint:6,cloudcover:8,seeing:6,transparency:3,liftedindex:2,rhm2:5,wind10m:"direction",speed:2,temp2m:29},
{prectype:"none",timepoint:9,cloudcover:8,seeing:6,transparency:3,liftedindex:2,rhm2:5,wind10m:"direction",speed:2,temp2m:29},
{prectype:"none",timepoint:12,cloudcover:9,seeing:6,transparency:3,liftedindex:2,rhm2:6,wind10m:"direction",speed:2,temp2m:28}
];
document.write(`<table border="1"
align="center"
cellpadding="3">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
<th>8</th>
<th>9</th>
<th>10</th>
</tr>`);
obj1.forEach(function(element,index) {
document.write(`
<tr>
<td>${element.prectype}</td>
<td>${element.timepoint}</td>
<td>${element.cloudcover}</td>
<td>${element.seeing}</td>
<td>${element.transparency}</td>
<td>${element.liftedindex}</td>
<td>${element.rhm2}</td>
<td>${element.wind10m}</td>
<td>${element.speed}</td>
<td>${element.temp2m}</td>
</tr>

`);

});
document.write(</table>);
</script>
</body>

</html>
👍1
<script>
let obj7 = { "product" : "astro" , "init" : "2022111506" , "dataseries" : [ { "timepoint" : 3, "cloudcover" : 8, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 5, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 29, "prec_type" : "none" }, { "timepoint" : 6, "cloudcover" : 8, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 6, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 28, "prec_type" : "none" }, { "timepoint" : 9, "cloudcover" : 7, "seeing" : 6, "transparency" : 3, "lifted_index" : -1, "rh2m" : 7, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 26, "prec_type" : "none" }, { "timepoint" : 12, "cloudcover" : 7, "seeing" : 6, "transparency" : 3, "lifted_index" : -1, "rh2m" : 8, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 26, "prec_type" : "none" }, { "timepoint" : 15, "cloudcover" : 7, "seeing" : 6, "transparency" : 3, "lifted_index" : -1, "rh2m" : 9, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 24, "prec_type" : "none" }, { "timepoint" : 18, "cloudcover" : 7, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 8, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 24, "prec_type" : "none" }, { "timepoint" : 21, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : -1, "rh2m" : 7, "wind10m" : { "direction" : "NE", "speed" : 2 }, "temp2m" : 26, "prec_type" : "none" }, { "timepoint" : 24, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : -1, "rh2m" : 6, "wind10m" : { "direction" : "N", "speed" : 2 }, "temp2m" : 26, "prec_type" : "none" }, { "timepoint" : 27, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 6, "wind10m" : { "direction" : "N", "speed" : 2 }, "temp2m" : 26, "prec_type" : "none" }, { "timepoint" : 30, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 8, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 27, "prec_type" : "none" }, { "timepoint" : 33, "cloudcover" : 7, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 8, "wind10m" : { "direction" : "S", "speed" : 2 }, "temp2m" : 25, "prec_type" : "none" }, { "timepoint" : 36, "cloudcover" : 7, "seeing" : 6, "transparency" : 4, "lifted_index" : 2, "rh2m" : 9, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 24, "prec_type" : "none" }, { "timepoint" : 39, "cloudcover" : 5, "seeing" : 6, "transparency" : 4, "lifted_index" : 2, "rh2m" : 9, "wind10m" : { "direction" : "E", "speed" : 2 }, "temp2m" : 24, "prec_type" : "none" }, { "timepoint" : 42, "cloudcover" : 6, "seeing" : 6, "transparency" : 4, "lifted_index" : 2, "rh2m" : 9, "wind10m" : { "direction" : "E", "speed" : 2 }, "temp2m" : 24, "prec_type" : "none" }, { "timepoint" : 45, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 8, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 26, "prec_type" : "none" }, { "timepoint" : 48, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 7, "wind10m" : { "direction" : "S", "speed" : 2 }, "temp2m" : 27, "prec_type" : "none" }, { "timepoint" : 51, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 6, "wind10m" : { "direction" : "S", "speed" : 2 }, "temp2m" : 28, "prec_type" : "none" }, { "timepoint" : 54, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 6, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 28, "prec_type" : "none" }, { "timepoint" : 57, "cloudcover" : 9, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 8, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 27, "prec_type" : "none" }, { "timepoint" : 60, "cloudcover" : 7, "seeing" : 6, "transparency" : 4, "lifted_index" : 2, "rh2m" : 10, "wind10m" : { "direction" : "S", "speed" : 2 }, "temp2m" : 25, "prec_type" : "none" }, { "timepoint" : 63, "cloudcover" : 2, "seeing" : 6, "transparency" : 5, "lifted_index" : 2, "rh2m" : 11, "wind10m" : { "direction" : "S", "speed" : 2 }, "temp2m" :
👍1
24, "prec_type" : "none" }, { "timepoint" : 66, "cloudcover" : 1, "seeing" : 6, "transparency" : 5, "lifted_index" : 2, "rh2m" : 11, "wind10m" : { "direction" : "S", "speed" : 2 }, "temp2m" : 25, "prec_type" : "none" }, { "timepoint" : 69, "cloudcover" : 4, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 6, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 28, "prec_type" : "rain" }, { "timepoint" : 72, "cloudcover" : 3, "seeing" : 6, "transparency" : 3, "lifted_index" : 2, "rh2m" : 4, "wind10m" : { "direction" : "SE", "speed" : 2 }, "temp2m" : 30, "prec_type" : "rain" } ] };

let product = obj7.product;
let init = obj7.init;
let dataseries = obj7.dataseries;

document.write(`<table border="1"
align="center"
cellspacing="10px"
cellpadding="10px">
<tr>
<th>timepoint</th>
<th>cloudcover</th>
<th>seeing</th>
<th>transparency</th>
<th>lifted_index</th>
<th>rh2m</th>
<th>direction</th>
<th>speed</th>
<th>temp2m</th>
<th>prec_type</th>
</tr>
<tr>
<td colspan="10">${product}</td>
</tr>
<tr>
<td colspan="10">${init}</td>
</tr>`);
dataseries.forEach(function(element,index){
document.write(`<tr>
<td>${element.timepoint}</td>
<td>${element.cloudcover}</td>
<td>${element.seeing}</td>
<td>${element.transparency}</td>
<td>${element.lifted_index}</td>
<td>${element.rh2m}</td>
<td>${element.wind10m.direction}</td>
<td>${element.wind10m.speed}</td>
<td>${element.temp2m}</td>
<td>${element.prec_type}</td>
</tr>`);
});
document.write(</table>);
</script>
👍1