Skip to content
Advertisement

Tag: spring

How you create confirmation link for email?

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

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

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 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

Advertisement