小编dev*_*man的帖子

创建类路径资源中定义的名为“gsonBuilder”的bean时出错 [org/springframework/boot/autoconfigure/gson/GsonAutoConfiguration.class]

我正在使用 Corda 版本 4。

以下是显示平台版本和其他依赖项的代码:

cordaReleaseGroup=net.corda
cordaVersion=4.0
gradlePluginsVersion=4.0.45
kotlinVersion=1.2.71
junitVersion=4.12
quasarVersion=0.7.10
log4jVersion =2.11.2
platformVersion=4
slf4jVersion=1.7.25
nettyVersion=4.1.22.Final
Run Code Online (Sandbox Code Playgroud)

以下是 springboot webserver 的版本 -

buildscript {
    ext.spring_boot_version = '2.0.2.RELEASE'
    ext.spring_version = '4.3.11.RELEASE'
    ext.spring_boot_gradle_plugin_version = '2.0.2.RELEASE'
    ext.slf4j_version = '1.7.25'
    ext.log4j_version = '2.9.1'
}
Run Code Online (Sandbox Code Playgroud)

节点已部署并成功运行,但运行 springboot webserver 时抛出错误。

运行 springboot web 服务器时抛出以下错误 -

W 14:54:44 1 AnnotationConfigServletWebServerApplicationContext.refresh - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gsonBuilder' defined in class path resource [org/springframework/boot/autoconfigure/gson/GsonAutoConfiguration.class]: Bean instantiation via factory method …
Run Code Online (Sandbox Code Playgroud)

build.gradle spring-boot corda

3
推荐指数
1
解决办法
6377
查看次数

ASP.NET Core 3.1 Razor 页面:如何自动从索引页面重定向到登录页面?

我正在使用 ASP.NET Core 3.1 MVC 和 Razor 页面构建一个 Web 应用程序。

我是 Razor 页面的新手。

我使用上面创建了一个基本应用程序。我想在应用程序启动时加载登录页面,但 Index.cshtml 页面似乎是起始页面。

为了从 Index.cshtml 页面(起始页面)重定向到我的 Login.cshtml 页面,我在 Index.cshtml PageModel 中执行了以下操作。但它不起作用。

编辑:

索引.cshtml:

    <div class="text-center">
        <h1 class="display-4">Welcome</h1>
        <p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
        <form method="get" asp-page="Index" hidden name="myForm">
            <input type="submit" name="submit" value="Redirect 1" asp-page-handler="Redirect1" hidden />
        </form>
    </div>
Run Code Online (Sandbox Code Playgroud)

索引.cshtml.cs:

public class IndexModel : PageModel
    {
        public IndexModel() 
        {
          OnPostRedirect1();
        }
        public void OnGet() {}
        public IActionResult OnPostRedirect1()
        {
            return RedirectToPage("Login");
        }        
    }
Run Code Online (Sandbox Code Playgroud)

如何自动从索引页面重定向到登录页面?

razor-pages asp.net-core-3.1

3
推荐指数
1
解决办法
8192
查看次数