小编Jee*_*eet的帖子

JSON不适当地转换长数字

我有一个简单的JSON,其中数字未被正确解析.

[
  {
    "orderNumber": 1,
    "customerId": 228930314431312345,
    "shoppingCartId": 22893031443137109,
    "firstName": "jjj"
  }
]
Run Code Online (Sandbox Code Playgroud)

我试过@ http://www.utilities-online.info/xmltojson/,结果是

<?xml version="1.0" encoding="UTF-8" ?>
<orderNumber>1</orderNumber>
<customerId>228930314431312350</customerId>
<shoppingCartId>22893031443137108</shoppingCartId>
<firstName>jjj</firstName>
Run Code Online (Sandbox Code Playgroud)

正如您所看到的...... XML与JSON不同.我是JSON的新手.我错过了什么吗?

json numbers converter

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

登录后 Spring Boot 重定向到请求的 URL

我有一个 Spring Boot UI 应用程序。我试图在登录后将用户重定向到最初请求的 URL。

当用户请求http://www.example.com/myapp/user/22 时,应用程序恰当地重定向到http://www.example.com/myapp/login。用户登录后,应用程序将重定向到http://www.example.com/myapp/dashboard。我希望应用程序重定向到http://www.example.com/myapp/user/22

我浏览了几个链接,觉得我有一个正确的配置,但是重定向没有按预期工作。

我的安全配置是

public class SecurityConfig extends WebSecurityConfigurerAdapter {
.....
....

    @Autowired
    private MyAuthenticationSuccessHandler authenticationSuccessHandler;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.
        authorizeRequests()
                .antMatchers("/user/**").authenticated()
                .and().csrf().disable().formLogin()
                .successHandler(authenticationSuccessHandler)
......
Run Code Online (Sandbox Code Playgroud)

我的成功处理程序是

    @Component
    public class MyAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
    ...
public MyAuthenticationSuccessHandler() {
        super();
        this.setDefaultTargetUrl("/myapp/dashboard");
        this.setUseReferer(true);
    }

        @Override
        public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
                Authentication authentication) throws IOException, ServletException {
            //Do something ..........
            ........
            .........
            super.onAuthenticationSuccess(request, response, …
Run Code Online (Sandbox Code Playgroud)

url-routing spring-security spring-boot

1
推荐指数
1
解决办法
4286
查看次数