小编lik*_*amp的帖子

java.lang.IllegalStateException:BindingResult和bean名称'category'的普通目标对象都不可用作请求属性

我在网上查看了几乎所有与此问题相关的答案,但无法在我的代码中找出问题所在.

这是我的JSP页面.

<form:form method="POST" commandName="category" modelAttribute="category" action="search_category">
    <form:input path="category_name" /> 
    <input type="submit" value="Submit">  
</form:form>
Run Code Online (Sandbox Code Playgroud)

当我删除

<form:input path="category_name" /> 
Run Code Online (Sandbox Code Playgroud)

它工作正常.我可以与我的控制器通信.所以问题与这条线有关.

@Controller
public class SearchCategory {

    @Autowired      
    private CategoryService categoryService;

    @RequestMapping(value = "/search_category",  method = RequestMethod.POST)
    public @ResponseBody String searchCategoryFromDatabase(@ModelAttribute("category") Category category, BindingResult result){        

        return "something";
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <!-- Processes application requests -->
    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/servlet-context.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

     <!-- The definition of the Root …
Run Code Online (Sandbox Code Playgroud)

java spring annotations hibernate spring-form

6
推荐指数
1
解决办法
4万
查看次数

JBOSS-LOCAL-USER:javax.security.sasl.SaslException:无法读取服务器质询

当我想从不同的服务器访问远程 Wildfly 服务器上的 EJB 时,出现以下错误。

Error: Authentication failed: all available authentication mechanisms failed:
   JBOSS-LOCAL-USER: javax.security.sasl.SaslException: Failed to read server challenge [Caused by java.io.FileNotFoundException: /../wildfly/standalone-/tmp/auth/X.challenge (No such file or directory)]
   DIGEST-MD5: Server rejected authentication
Run Code Online (Sandbox Code Playgroud)

如果我在服务器内访问 EJB,我不会收到任何身份验证错误。我使用以下方式访问服务器;

http-remoting://server1:8080
Run Code Online (Sandbox Code Playgroud)

基本上如果我在server1中调用这个,就没有问题。如果我从 server2 调用它,我会收到错误。我假设它在 server2 中查找 server1 中存在的 auth 文件。

我不确定是否必须在 EJB 或 Wildfly 上进行一些配置才能启用来自不同服务器的访问。我确实完成了网上提供的所有步骤,但显然我遗漏了一些东西。

java authentication jboss ejb wildfly-10

5
推荐指数
1
解决办法
2万
查看次数

Xcode 12 错误:多个命令产生 AccessibilityResources.bundle

从 Xcode 构建我的 React Native 项目会出现以下错误;

Multiple commands produce '/Users/USERNAME/Library/Developer/Xcode/DerivedData/PROJECT-grjkuplqgvolxebnwadcuuhwkdak/Build/Intermediates.noindex/ArchiveIntermediates/PROJECT/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':
1) Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/USERNAME/Library/Developer/Xcode/DerivedData/PROJECT-grjkuplqgvolxebnwadcuuhwkdak/Build/Intermediates.noindex/ArchiveIntermediates/PROJECT/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
2) Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/USERNAME/Library/Developer/Xcode/DerivedData/PROJECT-grjkuplqgvolxebnwadcuuhwkdak/Build/Intermediates.noindex/ArchiveIntermediates/PROJECT/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
Run Code Online (Sandbox Code Playgroud)

我检查了“多个命令产生”错误的其他答案,但到目前为止还没有运气。不过,它们主要与矢量图标有关。

如何修复 AccessibilityResources 的此错误?

xcode ios react-native xcode12

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