我有一个简单的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的新手.我错过了什么吗?
我有一个 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)