• Как возможно отправить запрос POST если контроллер ожидает GET?

    @P_Alexander Автор вопроса
    MaxLich, Вы бы лучше по делу что то сказали, а не болтали тут попусту.
  • Как возможно отправить запрос POST если контроллер ожидает GET?

    @P_Alexander Автор вопроса
    sim3x, я знаю для чего нужен каждый метод, поэтому и спросил дич это или что то где то я не увидел.
  • Как возможно отправить запрос POST если контроллер ожидает GET?

    @P_Alexander Автор вопроса
    MaxLich, вставлял ссылками они не работали. Можно просто скопировать и вставить в адресною строку.
  • Как возможно отправить запрос POST если контроллер ожидает GET?

    @P_Alexander Автор вопроса
    sim3x, Понял, просто как то странно что под видео и в статье откуда был взят этот код и просто скопирован, нет ни одного комментария по этому поводу..
    Спасибо.
  • Почему хибернейт не апдейтит таблицу?

    @P_Alexander Автор вопроса
    Мне аж стыдно...
    Спасибо!
  • Шаблон thymeleaf не работает, где я ошибся?

    @P_Alexander Автор вопроса
    Не все не так,
    По вашему тексту, мне не нужно вызывать фрагмент navigantion. потому что его реализовывает сам шаблон, а моя страница main.htm реализовывает шаблон! а именно вот в этой строке - layout:decorator="webapp/resources/thymeleaf/base-layout.html">
    И страница navigantion вызывается в самом шаблоне, и обьявлена в странице navigantion а именно в этой строке th:fragment="navigation"
    По поводу названий, думаю там можно называть как хотите.
    И ошибка над которой я просидел день была в том что я указывал неправильно путь до этого главного шаблона, и имя шаблона нужно указывать без префикса(layout:decorator="webapp/resources/thymeleaf/base-layout)
    Так же с новых версиях вместо decorator нужно decoratе
  • Как решить org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController'?

    @P_Alexander Автор вопроса
    Дмитрий Еремин, cпасибо за помощь, но вопрос я решил так:
    1 добавил зависимость в pom.xml
    <dependency>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-web</artifactId>
          <version>${spring.security.version}</version>
        </dependency>

    После этого начал получать ошибки что нет бина на стандартный фильтр спринга, который кстати был абсолютно правильно сконфигурирован.
    2 в файле web.xml я заметил что что мой фильтр был объявлен раньше чем загружался app-config.xml, в этот файл я импортировал все настройки спринга в том числе и спринг секюрити и как я понял что фильтр есть но бинов еще нет и поэтому летела ошибка.
    Решение - поднял загрузку файла спринга выше объявления фильтра, и все заработало как по маслу!))
    И я дико рад что у меня получилось это сделать, и вообще я заметил что в спринге часто ошибки в стектрейсе не соответсвуют решению проблемы.
  • Как решить org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController'?

    @P_Alexander Автор вопроса
    Это находил еще вчера, но не нашел там ответа, дико извиняюсь вы можете мне объяснить доступными словами, с чем моя проблема связана и как мне ее решить!?
  • Как решить org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController'?

    @P_Alexander Автор вопроса
    nubus4000,
    Вот мой web.xml
    <filter>
            <filter-name>springSecurityFilterChain</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>springSecurityFilterChain</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping> 
    
        <servlet>
            <servlet-name>spring</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/app-config.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>spring</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring-servlet.xml</param-value>
        </context-param>
    
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
  • Как решить org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController'?

    @P_Alexander Автор вопроса
    StackTrace
    22:21:39,835 WARN  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 2) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    22:21:39,837 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 2) Context initialization failed: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:581)
    	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:367)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1340)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
    	at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    	at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:215)
    	at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:184)
    	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    	at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
    	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:249)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
    	at java.lang.Thread.run(Thread.java:748)
    	at org.jboss.threads.JBossThread.run(JBossThread.java:485)
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1501)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1099)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1060)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:578)
    	... 37 more
    22:21:39,838 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 2) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./MakeYourDream: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./MakeYourDream: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
    	at java.lang.Thread.run(Thread.java:748)
    	at org.jboss.threads.JBossThread.run(JBossThread.java:485)
    Caused by: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:251)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    	... 8 more
  • HTTP Status 500, Jersey Rest как решить?

    @P_Alexander
    А что стектрейса нет?
  • Как исправить ошибку [org.thymeleaf.TemplateEngine] (default task-1) [THYMELEAF][default task-1] Exception processing template "index":?

    @P_Alexander Автор вопроса
    Нужная нам строчка в стректрейсе находится в самом конце:
    Caused by: org.attoparser.ParseException: An error happened during template parsing (template: "ServletContext resource [/WEB-INF/view/resources/layout.html]" - line 4, col 7)

    В станичке index.html я указываю где искать мой шаблон
    <html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml"
          xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
          layout:decorate="~{/WEB-INF/view/resources/layout}">

    В итоге получался такой путь - /WEB-INF/view/WEB-INF/view/resources/layout.html
  • Как исправить ошибку [org.thymeleaf.TemplateEngine] (default task-1) [THYMELEAF][default task-1] Exception processing template "index":?

    @P_Alexander Автор вопроса
    Сергей Горностаев, То просто пожелание, наставления мне, ну и как то уведомить всех, что вопрос решен)
  • Как исправить ошибку [org.thymeleaf.TemplateEngine] (default task-1) [THYMELEAF][default task-1] Exception processing template "index":?

    @P_Alexander Автор вопроса
    Бро да там просто нужно было правильно пути прописать, просто иногда читай весь стек трейс, удачи!
  • Как замапить на путь "/" index.html?

    @P_Alexander Автор вопроса
    Сергей Горностаев, localhost:8080 работает - стандартная страница сервера.
    Контроллер и все что я маплю на другие пути типо localhost:8080/MakeYourDream/home - то это работает нормально, а вот если иду на путь localhost:8080/MakeYourDream/ - то вот вылетат в стектрайс что нет маппинга.