In my project I need to send letter to user email with confirmation link. My solution: Add string column “code” and boolean column “is_active” (with default value false) to user table. When user register, generate unique string key and save to database. Send to email link, for example host.com/user/email/{code}/confirm Then find by the code (generated string value) user and set
Tag: spring
Spring web mvc example, boot, Error creating bean with name ‘jacksonObjectMapperBuilder’
I’m new to Spring and largely to Java beyond the language itself…minimal console apps, etc. I’m trying to get the Spring website example here (https://spring.io/guides/gs/serving-web-content/) to work and I’m trying to stick with the spring boot piece used in the example rather than bailing and creating my own servlet class, etc. Using Netbeans 8 on OS X Yosemite. I’ve been
Hibernate : self join confusion?
I have a category table.In which first 5 are main category and others are sub category. I need to fetch the sub categories of first 5 main category so i have found the sql query The query is joining the same table itself.and am getting the result given below Result How can i convert the SQL query to HQL and
Unable to local MySQL database with Spring app deployed through Tomcat
I’m trying to create a web application using Spring and Hibernate, deploying it through Tomcat 8. I’ve setup MySQL and Tomcat 8 locally on my machine, and am able to deploy the web application to it. …
Get Set value from Redis using RedisTemplate
I am able to retrieve values from Redis using Jedis: But when I am trying to use Spring’s RedisTemplate , I am not getting any data. My data is stored in Redis as a Set. Can someone please point out to me what am I missing? EDIT : My xml config for RedisTemplate. Answer In short You have to configure
How to load an external property file to Spring Boot in Wildfly
I wonder how can I load an external property of my application running inside Wildfly 9 as WAR, I tried to add a java parameter to Wildfly execution but it seems the application did not recognize the properties. Is there any way how Spring Boot could read the external property file? I am trying to load and run one Spring
How to send byte[] array in retrofit
How do you send byte[] array in retrofit call. I just need to send over byte[]. I get this exception when I have been trying to send a retrofit call. retrofit.RetrofitError: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 2 What is the way I can make the call using retrofit. I was simply passing byte array as a ByteMessage encapsulated in the
object references an unsaved transient instance – save the transient instance before flushing: com.entity.Role
I’m getting object references an unsaved transient instance – save the transient instance before flushing: com.entity.Role exception while trying to insert some values in table using hibernate related dependencies in pom.xml are Role.java is User.java is I’m using repository as mentioned in this video, are and and InitDbService.java is I have seen this SO Answer, but still getting this error
Spring batch FileItemWriter not creating file at correct path
I have a spring batch service containing a FileItemReader,FileItemProcessor and FileItemWriter.When creating the FileItemWriter I have to set the Resource that will be my output file. I am running the batch service on websphere on a Linux machine.The problem is if I set the resource as new FileSystemResource(new File(“opttemp1myFile.txt”)), the path of the file created is “/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/opttempmyFile.txt” which is not
What does decoupling two classes at the interface level mean?
Lets say we have class A in package A and class B in package B . If object of class A has reference to class B, then the two classes are said to have coupling between them. To address the coupling, …