spring-mvc

Can't get user information after login successfully in WSO2 Identity server

感情迁移 提交于 2020-01-05 04:22:08
问题 After login successfully into WSO IS with service URL (https://localhost:9443/services/") I tried to get User Information as below : try { UserRealm realm = WSRealmBuilder.createWSRealm(serviceURL, authCookie, configCtx); UserStoreManager storeManager = realm.getUserStoreManager(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } But I had exception relating to this as below image. I can't get any info. I tried and found out that the main error is I can't

How to hide spring mvc web app name in the browser url?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 04:02:23
问题 I have a spring mvc 3.x web app in eclipse where the resource project artifact name is "webapp". So, http://localhost:8080/webapp will load the main home page using tomcat 7 with the eclipse IDE. However, when I release to tomcat 7.0 to some prod servers I don't want the URL to resolve to http://mywebsite.com/webapp but instead http://mywebsite.com How can I achieve this? 回答1: You can follow either of below approaches Delete existing ROOT/ directory (in webapps) from tomcat and rename your

Spring Data entityManagerFactory NoClassDefFoundError

ⅰ亾dé卋堺 提交于 2020-01-05 04:00:08
问题 I've created a new Spring REST API with Spring Initializr and added JPA, Lombok, PostgreSQL and Spring Web. Sadly I get the following error on startup: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at

Calling a function from Spring Webflow to store in Database(MySQL)

亡梦爱人 提交于 2020-01-05 03:46:43
问题 I have the following POJO class called ProcessOrder @Id @GeneratedValue private int id; private String productname; private int customerid; private String customerName; private String shippingAdress; private int productid; private int quantity; private int status; And this class called CartItem @Id @GeneratedValue private int cartItemId; @ManyToOne @JoinColumn(name = "cartId") @JsonIgnore private Cart cart; @ManyToOne @JoinColumn(name = "productId") private Product product; private int

Calling a function from Spring Webflow to store in Database(MySQL)

点点圈 提交于 2020-01-05 03:45:28
问题 I have the following POJO class called ProcessOrder @Id @GeneratedValue private int id; private String productname; private int customerid; private String customerName; private String shippingAdress; private int productid; private int quantity; private int status; And this class called CartItem @Id @GeneratedValue private int cartItemId; @ManyToOne @JoinColumn(name = "cartId") @JsonIgnore private Cart cart; @ManyToOne @JoinColumn(name = "productId") private Product product; private int

Download XLS file via POST to Spring MVC

孤街浪徒 提交于 2020-01-05 03:26:48
问题 Please I am annoyed with a problem. I need to download a xls created on the fly on the Java. This is my client-side code: exportToExcel: function(filters, exportData) { $.ajax ({ type: "POST", url: 'status/exportToExcel', async: true, data: {columns: exportData, filters: JSON.stringify(filters)}, success: function (data) { var blob = new Blob([data], { "type" : "application/vnd.ms-excel" }); var objectUrl = URL.createObjectURL(blob); window.open(URL.createObjectURL(objectUrl)); }, error:

Spring @Transactional annotation is not working

风流意气都作罢 提交于 2020-01-05 03:08:06
问题 I'm trying to run entityManager.merge(myEntity) within the following method but it seems that the @Transactional annotation is ignored. The Hibernate configuration seems to be fine because I can successfully fetch data from the db but it's not possible to write to the db. I'm using Spring version 3.2.3. Why are the writing db operations not working? my method that does not work package com.reflections.importer.bls; ... @Service class BlsGovImporter { ... @Transactional private void

FilterChainProxy: /j_spring_security_check has no matching filters

故事扮演 提交于 2020-01-05 03:03:17
问题 I am trying to use Spring security default login mechanism and this is what I have configured in security.xml file <http pattern="/customer/**" auto-config="true" use-expressions="true" authentication-manager-ref="customerAuthenticationManager"> <intercept-url pattern="/customer" access="hasRole('AUTH_CUSTOMER')" /> <intercept-url pattern="/customer/" access="hasRole('AUTH_CUSTOMER')" /> <intercept-url pattern="/customer/*.html" access="hasRole('AUTH_CUSTOMER')" /> <intercept-url pattern="

Can Spring MVC strictly map query strings to request parameters?

别说谁变了你拦得住时间么 提交于 2020-01-04 21:35:46
问题 Is there any way to configure Spring-MVC to strictly accept a known list of query strings? I'm looking to validate submitted query strings -- if a request has additional query string parameters, I'd like to know about it and return a 404. My motivations are as follows: Clarity: I don't want clients to fat-finger a request parameter, and still get results back (as if no request parameter was supplied) HTTP caching: I'd like to limit the number of valid HTTP routes for my service so that HTTP

Can Spring MVC strictly map query strings to request parameters?

我的未来我决定 提交于 2020-01-04 21:34:07
问题 Is there any way to configure Spring-MVC to strictly accept a known list of query strings? I'm looking to validate submitted query strings -- if a request has additional query string parameters, I'd like to know about it and return a 404. My motivations are as follows: Clarity: I don't want clients to fat-finger a request parameter, and still get results back (as if no request parameter was supplied) HTTP caching: I'd like to limit the number of valid HTTP routes for my service so that HTTP