Spring

Spring Integration Gateway with no arguments

老子叫甜甜 提交于 2021-02-08 13:34:05
问题 On my gateway, I have a method @Gateway String commsTest(); The idea is that I can call commsTest from the bean and use spring integration to wire it up to the service activator that will check comms. When I do that I get a receive is not supported, because no pollable reply channel has been configured error. I realise that this is because a method with no params means "I am trying to poll a message from the channel" This is a two part question. What does it mean to poll a message from the

Empty content in spring mvc test

Deadly 提交于 2021-02-08 13:20:24
问题 I could not test page content with spring mvc test because it is empty. Given simplest possible controller: @RequestMapping(value = "/home") public String home(HttpSession session, ModelMap model) { return "home"; } relevant tiles config: <definition name="base.definition" template="/jsp/view/application.jsp"> <put-attribute name="header" value="/jsp/view/header.jsp" /> <put-attribute name="menu" value="/jsp/view/menu.jsp" /> <put-attribute name="title" value="" /> <put-attribute name="body"

Springframework.dao.InvalidDataAccessResourceUsageException hibernate.SQLGrammarException MySQLSyntaxErrorException

笑着哭i 提交于 2021-02-08 12:57:18
问题 I'm breaking my head trying to find out what's wrong here. I'm working on a schema: It has a Story entity (table: stories) and I'm trying to add a column to this stories.portofoliotype_id which is a foreign key to PortfolioType (table: portofoliotypes) . I think I have the annotations right, I even logged MySQL queries, it gets the following query, which is correct. I'm trying to create a new story: insert into stories(backlog_id, description, iteration_id, name, parent_id,portfoliotype_id,

Issue with CORS and error and Access-Control-Allow-Origin header

社会主义新天地 提交于 2021-02-08 12:38:09
问题 Hi I cant disable CORS in my project. I use a custom filter and Spring Security Config for the CORS configuration. I have seen this excellent answer: Can you completely disable CORS support in Spring? but when I have tried the below implementation I still get the CORS error: CORS configuration: @Component @Order(Ordered.HIGHEST_PRECEDENCE) class CorsFilter @Autowired constructor() : CorsFilter(configSrc()) { companion object { private fun configSrc(): UrlBasedCorsConfigurationSource { val

Is Spring.NET project dead?

▼魔方 西西 提交于 2021-02-08 12:34:40
问题 We are considering using Sprint.NET as AOP framework along with other solutions. Spring.NET is a known framework, at least by name like in my case. I try to find the informations about latest release and support but I can't find anything after 2012 to my surprise. Is the project dead ? Where is the up-to-date website/forum/support? Google did not really helped me on that point :( 回答1: Despite having a dead website, nor being listed at spring.io, there is still (in 2015 at least) development

Is Spring.NET project dead?

半腔热情 提交于 2021-02-08 12:34:05
问题 We are considering using Sprint.NET as AOP framework along with other solutions. Spring.NET is a known framework, at least by name like in my case. I try to find the informations about latest release and support but I can't find anything after 2012 to my surprise. Is the project dead ? Where is the up-to-date website/forum/support? Google did not really helped me on that point :( 回答1: Despite having a dead website, nor being listed at spring.io, there is still (in 2015 at least) development

Can not access deployed WAR file on Tomcat

笑着哭i 提交于 2021-02-08 11:55:52
问题 I have a Spring boot rest service project which works on my local machine. When I run the application as "Spring Boot App" I can access the rest service by going to http://127.0.0.1:8080/persons/all and it returns JSON as it's supposed to. I changed the pom.xml packaging to war, I then created a war by going to Run as -> Maven build in Spring tools suit. It creates a war file. When I upload the war file on http://myserverip:8080/manager/ I get no errors and it shows up under Applications The

How to configure MessageDispatcherServlet programmatically

不问归期 提交于 2021-02-08 11:51:07
问题 I am trying to learn spring-ws and started with this tutorial: http://spring.io/guides/gs/producing-web-service/#initial. What I would like to do now is to start the service on non-embedded servlet container by configuring the application programmatically. I am stuck on how to setup Message Dispatcher Servlet without web.xml. What i tried to is to implement WebApplicationInitializer interface's method onStartup(ServletContext servletContext). public class ServerInitializer implements

Java handle invalid request Mapping urls including decodings

你说的曾经没有我的故事 提交于 2021-02-08 11:29:41
问题 in my apiController, I have @Controller @RequestMapping("api/v1/myservice") @Slf4j public class APIController { @RequestMapping(value = "/validAPI1", method = RequestMethod.GET) @ResponseBody public String validAPI1() { return "success"; } } I want to catch invalid incoming API requests, such as /api/v1/myservice/random124 , and this can be done by adding a method at the end: @RequestMapping(value = "/**", method = RequestMethod.GET) @ResponseBody public String handleInvalidAPIReq() { return

Spring MVC + Ajax JSON post

你离开我真会死。 提交于 2021-02-08 11:20:26
问题 I have a problem with send JSON to the Controller . I can't understand my problem. So, url - /notes/{username}/add Ajax : $.ajax({ type: "POST", contentType : 'application/json; charset=utf-8', dataType : 'json', url: window.location.pathname, data: JSON.stringify({ title: $("#title").val(), text: $("#text").val() }), success : function() { $("#title").val(""); $("#text").val(""); } }); Controller : @RequestMapping(value = "/{username}/add", method = POST) public void add(@RequestBody Note