当前位置: 首页 > 知识库问答 >
问题:

weblogic服务器中的thymeleaf登录错误

宗意蕴
2023-03-14

我正在尝试从IntelliJ登录我的应用程序,所有的一切都是好的!但是当我将相同的程序部署到weblogic服务器上时,我无法登录系统。在weblogic日志中;

<The exception "The request content-type is not a multipart/form-data" occurred when processing getParameter or getParameterValues from a multipart value of a ServletRequest.> 
<The exception "The request content-type is not a multipart/form-data" occurred when processing getParameter or getParameterValues from a multipart value of a ServletRequest.> 
<The exception "The request content-type is not a multipart/form-data" occurred when processing getParameter or getParameterValues from a multipart value of a ServletRequest.> 
<The exception "The request content-type is not a multipart/form-data" occurred when processing getParameter or getParameterValues from a multipart value of a ServletRequest.>

这是我的html表单;

<form class="col s12" action="#" th:action="@{/admin/login}" method="post">
    <div class="row">
        <div class="input-field col s6 offset-s3">
            <input name="username" id="first_name" type="text" class="validate">
            <label for="first_name">user:</label>
        </div>
    </div>

    <div class="row">
        <div class="input-field col s6 offset-s3">
            <input name="password" id="password" type="password" class="validate">
            <label for="password">pass:</label>
        </div>
    </div>

    <button class="btn waves-effect waves-light col s2 offset-s3 cyan" type="submit" name="action">
        login <i class="material-icons right">send</i>
    </button>
</form>

这里是登录控制器;

@RequestMapping(value = "admin/login")
public String liste() {
    return "login";
}

请求URL:http://localhost:7001/Avantaj/admin/home请求方法:获取状态代码:302临时移动远程地址:[::1]:7001引用策略:no-referrer-when-downgrade响应头查看源缓存-控件:no-cache,no-store,max-age=0,必须重新验证连接:关闭日期:thu,Nov 2017年11月23日14:31:25 GMT过期:0位置:http://localhost:7001/Avantaj/admin/login pragma:no-cache set-cookie:jsessionid=girpslveeykuhjdh1zww-wbtiaajhehegpkbwosn1n6tejzxlpa G!-542853697;路径=/;HttpOnly传输-编码:分块请求标头视图源接受:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8接受-编码:gzip,deflate,br接受-语言:tr-tr,tr;q=0.9,en-us;q=0.8,en;q=0.7缓存-控制:无缓存连接:保持活动cookie:jsessionid=3996ab4039dc5f2230033d6b816c498f;Jenkins-timestamper-offset=-10800000;Jenkins-timestamper=系统;Jenkins-TimeStamper-Local=false;IDEA-1D074CC6=2BD3BBFA-1A60-4E9F-9163-645455C02386;AdminConsolession=Z_NPKVR7H0HVII2TSVKQP086YTY0SXE3GYM9GYT3M8V-8B7UGVPN!-542853697;jsessionid=kyrpsjqm-xz659r5ldorovvp9ns5t8oc0mlqejaidrs2r5oskahg!-542853697主机:localhost:7001 pragma:no-缓存引用:http://localhost:7001/avantaj/admin/login upgrade-insecure-requests:1用户-代理:mozilla/5.0(Windows NT 6.1;win64;x64)applewebkit/537.36(KHTML,像Gecko)chrome/62.0.322.94 safari/537.36

SpringSecurityConfig:

@Override
protected void configure(HttpSecurity http) throws Exception {
    enhancer.addRecaptchaSupport(http.formLogin()).loginPage("/admin/login").permitAll()
        .and().csrf().ignoringAntMatchers("/api/**")
        .and().authorizeRequests().antMatchers("/admin/**").fullyAuthenticated()
        .and().headers().defaultsDisabled().cacheControl();
}

共有1个答案

葛炜
2023-03-14

请使用:

@PostMapping("/admin/login")
public String liste() {
  return "login";
}

并且在您的表单中:

<form class="col s12" action="#" th:action="@{/admin/login}" method="post">
...
 类似资料:
  • 使用以下命令登录 ftp服务器: lftp ftp://用户名[:密码]@服务器地址[:端口] #标准方式,推荐 lftp 用户名[:密码]@服务器地址[:端口] lftp 服务器地址 [-p 端口] -u 用户名[,密码] lftp 服务器地址[:端口] -u 用户名[,密码] 如果不指定端口,默认 21 如果不在命令中使用明文输入密码,连接时会询问密码(推荐) 可以使用“书签”收藏服务器

  • 我从命令行启动Oracle安装程序。路径为: C: \程序文件\ Java\jdk1.8.0\u 131\bin\Java-jar fmw\u 12.2.1.3.0\u wls。罐子 安装完成后,安装。cmd正在启动,并在命令行中显示: 进线过长。意外外观::process\u classpath。C: \Users\User\AppData\Local\Temp\OraInstall2017-1

  • 我已经在我的机器上安装了Weblogic server。安装时,我已使用名称MyDomain配置域。在配置结束时,我检查了启动管理服务器。服务器成功启动,没有问题。第二天,我尝试使用C:\ProgramData\Microsoft\Windows\start Menu\Programs\Oracle Enterprise Pack for Eclipse\User Projects\MyDomai

  • 当我使用sqlplus客户端登录到oracle 12时,我面临以下错误/警告。 SQL*Plus:12.1.0.2.0版于2019年11月8日星期五05:38:11发布 版权所有(c)1982年,2014年,甲骨文。版权所有。 订户-1581956048创建失败:上次成功登录时间:2019年11月8日星期五05:36:31-05:00 连接到:Oracle数据库12c企业版发布12.1.0.2.0

  • web.xml weblogic.xml

  • 我正在尝试将一个简单的SpringBoot应用程序转换为部署在WebLogic中。它在buildin TomCat服务器上运行良好。然后对其进行更改并创建一个新的war文件。当我尝试部署war文件时,我得到这个错误。 web.xml的Servlet初始值设定项 application.java文件