gpt4 book ai didi

java - 从零开始的 Spring MVC 教程

转载 作者:IT老高 更新时间:2023-10-28 21:12:36 25 4
gpt4 key购买 nike

我对 Spring 编码很陌生..我之前问了一个问题,但没有人回答,所以我问的是另一种方式..!我需要将我的应用程序从简单的 Java 迁移到 Spring MVC。

有没有什么好的 Spring MVC 从头开始提供信息的教程??

我的简单代码如下。

public void run()
{
try
{
DataInputStream din = new DataInputStream (
m_connection.getInputStream() );

PrintStream pout = new PrintStream (
m_connection.getOutputStream() );

// Read line from client
String data = din.readLine();

// Check to see if we should simulate a stalled server
if (shallWeStall)
{
// Yes .. so reset flag and stall
shallWeStall = false;

try
{
Thread.sleep (20000);
} catch (InterruptedException ie ) {}
}
else
{
// No.... but we will next time
shallWeStall = true;
}

// Echo data back to clinet
pout.println (data);

// Close connection
m_connection.close();
}
catch (IOException ioe)
{
System.err.println ("I/O error");
}
}

我尝试了谷歌搜索,但我发现的一切都太难了。

最佳答案

更新:由于 Spring 团队的惊人努力,此处发布的链接有点过时了。我会建议任何想要从头开始学习 Spring 的人前往 new awesome guides由 spring 团队创建。

可以在 Github 找到相同的示例代码

原答案:

试试这些链接.. 希望它们有用。 mkyongvanilla

当然还有 Spring's own site

添加:发现这个新的真棒blog也试试这个。。它彻底。:)

关于java - 从零开始的 Spring MVC 教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7025425/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com