Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java DispatcherServlet无法找到HTTP请求的映射URI_Java_Spring_Spring Mvc_Weblogic - Fatal编程技术网

Java DispatcherServlet无法找到HTTP请求的映射URI

Java DispatcherServlet无法找到HTTP请求的映射URI,java,spring,spring-mvc,weblogic,Java,Spring,Spring Mvc,Weblogic,我知道也有类似的问题,但我已经做了页面上提到的更正,但每当我重定向到我的着陆控制器时,我就会出现这个错误 2021-05-10 09:30:54 DEBUG DispatcherServlet:693 - DispatcherServlet with name 'mvc-dispatcher' processing POST request for [/myPortal/jsp/MyClientControllerServlet] 2021-05-10 09:30:54 WARN PageNo

我知道也有类似的问题,但我已经做了页面上提到的更正,但每当我重定向到我的着陆控制器时,我就会出现这个错误

2021-05-10 09:30:54 DEBUG DispatcherServlet:693 - DispatcherServlet with name 'mvc-dispatcher' processing POST request for [/myPortal/jsp/MyClientControllerServlet]
2021-05-10 09:30:54 WARN  PageNotFound:947 - No mapping found for HTTP request with URI [/myPortal/jsp/MyClientControllerServlet] in DispatcherServlet with name 'mvc-dispatcher
下面是我的配置,有人能告诉我哪里出了问题吗

my web.xml

<?xml version="1.0"?>
<web-app id="WebApp_ID" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
        <servlet-name>mvc-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/mvc-dispatcher-servlet.xml</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
</web-app>

我通过在dispatch-servlet.xml文件中添加下面的块来解决这个问题

<mvc:annotation-driven />

<bean id="handlerMapping"
    class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    <property name="alwaysUseFullPath" value="true" />
</bean>

<?xml version="1.0" encoding="UTF-8"?>

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    <context-root>/myPortal</context-root>
</weblogic-web-app>
package com.microsoft.aad.adal4jsample;

@Controller
@RequestMapping("/jsp/MyClientControllerServlet")
public class AadController {

    @RequestMapping(method = { RequestMethod.GET, RequestMethod.POST })
    public String getDirectoryObjects(ModelMap model, HttpServletRequest httpRequest) {
<mvc:annotation-driven />

<bean id="handlerMapping"
    class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    <property name="alwaysUseFullPath" value="true" />
</bean>