我是Spring的新手,我正在尝试创建一个学习应用程序,但我在自动装配中遇到问题,我正在添加我的代码.我正在弹簧靴.
Spring Boot Code
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
LoginBean.java
@Service
@Component
public class LoginBean {
private String userId;
private String pwd;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
Run Code Online (Sandbox Code Playgroud)
DemoRestController.java
@RestController
@EnableAutoConfiguration
@RequestMapping("/demo")
@Component
public class DemoRestController {
private final LoginBean loginBean;
@Autowired
public DemoRestController(LoginBean loginBean) …Run Code Online (Sandbox Code Playgroud) 我为reactjs找到了两个不同的引导程序
两者的基本区别和主要区别是什么?
这是我的代码:
// Import io so we can use file objects
import java.io.*;
public class SearchThe {
public static void main(String args[]) {
try {
String stringSearch = "the";
// Open the file c:\test.txt as a buffered reader
BufferedReader bf = new BufferedReader(new FileReader("test.txt"));
// Start a line count and declare a string to hold our current line.
int linecount = 0;
String line;
// Let the user know what we are searching for
System.out.println("Searching for " + stringSearch + " …Run Code Online (Sandbox Code Playgroud) 我想打开一个jsp页面而不访问我的servlete代码.即我既不必在我的jsp代码中输入我的url(action ="url"),也不必访问我的Servlete代码.
<form id="main" method="post" name="main" action="dpRegPost" onsubmit="return validate();">
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我吗?
我正在添加屏幕截图以获取更多信息。我是 Java8 的新手,如果我问的问题不好,请原谅我。当我研究空格分隔值的输入时,我得到了这个陈述。我知道下面的语句将值作为1 2 3值并将值[1, 2, 3]作为列表返回。
如果我错了,请纠正我
Stream:用于集合进行迭代。
bufferedReader.readLine():它将行读取为字符串
,稍后它会解析为 Integer 并被收集到 List 中我的疑问是当我输入1 2 3哪个是字符串时。那么,这个流是先用空间分割值然后迭代分割值吗?或者它是第一次解析值,然后将值存储在列表中,然后将值与空格分开并删除空格并替换为,. 我很好奇,下面的语句究竟是如何工作的。
List<Integer> a = Stream.of(bufferedReader.readLine().replaceAll("\\s$", "").split(" "))
.map(Integer::parseInt)
.collect(toList());
[1]: https://i.stack.imgur.com/nlXxd.jpg
Run Code Online (Sandbox Code Playgroud) 我在下面的代码中传递值0
Dim searchtext As Varient
Public Sub xyz_page_load()
searchtext = 0
If searchtext = "" Or searchtext = Empty Then
Debug.Print "Error" 'this line should not execute.
Else
Debug.Print "Good"
End If
End Sub
Run Code Online (Sandbox Code Playgroud)
它不应该进入"错误"代码行.任何人都可以让我知道为什么会这样吗?为什么varient数据类型将0视为空或空白?
java ×4
excel ×1
excel-vba ×1
java-stream ×1
javascript ×1
jsp ×1
jsp-tags ×1
reactjs ×1
reactstrap ×1
spring-boot ×1
vba ×1
word-vba ×1