The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise ...

learn more… | top users | synonyms

-1
votes
0answers
15 views

scalable reliable application to be built. can this code handle multiple requests? [on hold]

I am building web services for mobile applications and I am using Hibernate + spring + maven structure. My Controller is like this : ...
1
vote
0answers
45 views

Updating many fields based on data from a web service

I have to receive data from a webservice and need to compare the received data with the data in our DB. Its easy like: get a streetname from the WS, if its not null and not equals the Db entry -> ...
1
vote
2answers
58 views

Write into the same CSV file multiple times

I implemented an OutputWriterService.class to write content in the same file multiple times. The writeToCsvFile method is ...
0
votes
0answers
28 views

Spring: Redirecting to a REST url on click

I have a page where a user can click on a link and send them to another url where the path variable is the user name. So example: user name is bmarkham. bmarkham is on www.website.com/welcome. ...
0
votes
0answers
24 views

Correct use of SettableListenableFuture?

For the code below, is there any advantage of returning the SettableListenableFuture rather than the ...
2
votes
0answers
40 views

Pagination links for various lists using Spring-HATEOAS

I'm using Spring HATEOAS to create some links on my REST API. However, the entities i'm returning are very close, so the code to generate the links are the same: ...
2
votes
1answer
38 views

An asynchronous service to produce a results cache for a list of items

What I've created is a CacheBuilder service that will be passed in a list of items, and will build a results cache. The results are produced by making calls to ...
-1
votes
1answer
34 views

Spring Web MVC where to put logic [closed]

I am trying to create an application where I need to know where to put the logic. Here is the code HomeController.java ...
0
votes
1answer
63 views

breadcrumbs in spring

Breadcrumbs should look like this: Home > Mobiles & Tablets > Mobile Phones > Phone Super Duper every product belongs only to one category. e.g Phone Super Duper can be found only under Mobile ...
0
votes
1answer
77 views

Detect that a class is marked by a custom annotation in Spring

I would like to enable application behaviour based on the presence of a custom annotation that marks the configuration class (normally named something like ...
1
vote
0answers
60 views

AspectJ aspect for securing controller methods with ReCaptcha

Today when I was implementing ReCaptcha (as if there is much to implement!), I thought it would be perfect to create an Aspect Annotation to automatically secure web methods with recaptcha. My ...
1
vote
1answer
36 views

Seperate out validations from a service and use custom exceptions for entities not found

I am using spring-boot, spring data, and Java 6. Here is an example from a business layer to save student details. Srvice interface: ...
3
votes
1answer
75 views

Implementation of observer pattern in web app to monitor an RSS feed

I implemented observer pattern and it will be great if someone can do review of my work and say what should be done better. What is the problem. Application monitoring rss channel, if there is ...
4
votes
0answers
196 views

Implement two level caching using spring's cache abstraction Cache and CacheManager

Details about spring's caching framework are here. When I was reading this link, I thought the composite cache mentioned there was one that used levels of caching based on the order given to the ...
3
votes
0answers
45 views

Implementing a long-running entity lock

Requirement I have an entity named ImportData which can be processed once in order to extract data from a file fed to the application. I need to make sure that, ...
10
votes
1answer
117 views

Handling Java instant Ajax request/respond with Angular

I am trying to build a food search app. I am using Angular and Spring. I am currently using the yelp API, but it's done on the Java side. I think what I have achieved is really bad design. It works, ...
2
votes
0answers
24 views

Minimizing database overhead by storing additional information to the users authentication-object (Spring Security)

I am using Spring Security in order to check if a logged in user is authenticated. However, after authentication, as some actual requests come in, I would like to minimize the number of database calls ...
6
votes
1answer
228 views

Preventing XSS attacks in a Spring MVC application controller

One of the URL in my application is vulnerable to XSS attack, so I am handling it in the below way. I created a util class: ...
3
votes
1answer
110 views

Key to Value / Value to Key - java

I want to get the key from value / and value from key ,can anyone help to do in better way ? or can we implement the below code using java enum or spring or apache enumutils or java generic ? Note : ...
2
votes
3answers
235 views

Adding two different group of objects to a list of groups

I have two lists of Strings and two lists of objects. I need to copy the list of strings to the correspondence list of objects with specific values. ...
5
votes
2answers
135 views

Getting products by category, price, etc

I have the following concerns: Is Set a good choice for getting products? What are drawbacks of Set for this purpose? Is it ...
2
votes
1answer
102 views

Customize data types in a generated model with hibernate

I have a Spring/Hibernate application with the following domain class (irrelevant code stripped for brevity): ...
12
votes
1answer
266 views

Java Spring Example Web API

I'd like to get some feedback on an example web API I've put together. It's mavenized and available on GitHub here. Setup The only thing you'd have to change to run this locally is line 31 in ...
1
vote
1answer
154 views

Spring Security Web Configurer Adapter

guys. The code below is spring security web adapter. I do not like configure(HttpSecurity) method that generates security confirmation policy. Any ideas to do it more readable and clear? ...
1
vote
1answer
41 views

Simple Spring Service code

I used Spring MVC arch, and I need to be informed about correct names of methods and exceptions throwing. ...
0
votes
1answer
181 views

Print Java Object graph

Please share your comments and better ideas, to print java graph, which manipulates selected (@Mask) fields as XX, thus avoid logging confidential data, through ...
4
votes
2answers
83 views

Property file loader

I have the following code: ...
0
votes
0answers
64 views

Spring resttemplate and service to handle article tags

I have a RESTController, Service, and Repositories to help me handle Tags on articles. I am however not exactly happy with the way it's structured now, mostly when it comes to the exceptions being ...
1
vote
1answer
48 views

Retrieving three separate sorted lists of items

I need to search for records based on their area, postcode, city and sort each group ...
2
votes
2answers
72 views

Job execution on records supplied by database

I have a requirement to check all records in a table which is big (Around 1.5-2 million records). What I am doing is very simple, just get all the records and loop through one by one, and do things. I ...
7
votes
2answers
950 views

Registration, login and logout in a Grails application

I'm completely new to Groovy, but have many years of Java experience, and recently I have started working on a Grails application, currently it contains the following: User and Person domain classes ...
3
votes
1answer
605 views

Converting code for javax.xml.soap.* to webServiceTemplate

I am able to send requests to the web service using javax.xml.soap.*. I would like to convert the code to use ...
5
votes
1answer
167 views

Handling an invalid SQL query exception

This is my DAO object that takes the Cypher query as a string, and returns a JSON representation of the graph it returns. Because it's using a Spring JdbcTemplate ...
2
votes
2answers
35 views

Storing recent search phrases

I have a search on a very simple spring-powered website and I want to display 10 recent inputs: ...
2
votes
1answer
335 views

Async processes in Java Spring

I need to refactor this class having in mind that the logic inside the call methods is not so short and it require spring dependencies to work, the base class I have is: ...
0
votes
0answers
92 views

Optimize groovy DAO

I have a DocDao which is configured with the docDataSource as below docDataSource configuration from applicationContext.xml ...
3
votes
2answers
37 views

REST service to list new, continuing, and terminated subscribers during some period

I have a use case which says: Your REST service will consume a JSON object that contains a list of emails for subscribers at the start of the subscription period, and a list of subscribers at ...
1
vote
1answer
308 views

Environment-specific code in @Async mail method with Spring

I have a Spring @Service to asynchronously send emails. The part that seems to be a bit off to me is some code that is specific to our QA environment. We want to send and receive all emails through ...
1
vote
1answer
41 views

Re-using this piece of code for different objects

To give a little context before showing the problem: I am creating a RESTful web application. A User can have multiple addresses, emails, phones and projects. Each of these is represented similar to ...
3
votes
1answer
2k views

Spring oauth2 token store supported by redis

I had to make a demo for Spring oauth2 with redis store for tokens. I started with the sparklr2 (with tonr2) sample app from here. They are demo apps to show oauth2 powered by spring. Sparklr is the ...
2
votes
1answer
70 views

Handle NullValueInNestedPathException

I am looking for a elegant solution to this. I am new to Spring framework. I have a method: ...
4
votes
1answer
149 views

Static method to get user ID

I have a method which extracts the logged-in user details from a SpringSecurityContext object. I have read that only utility methods (which does certain ...
4
votes
0answers
135 views

Property Change Listener for Entity Management

I would like to know if the solution I came up with for managing relationships between entities is sensible. Guys in my team feel it is transparent, but maybe I'm missing a pitfall somewhere? ...
2
votes
2answers
686 views

Using FlatFileItemReader and asynchronous processors

I have a simple .csv file with ~400,000 line (one column only). It takes me a lot of time to read the records and process them. The processor validating records against couchbase. The writer - ...
42
votes
2answers
2k views

You are being watched! - Comments of Interest

You are being watched Code Review has an open system A machine that spies on you on every hour of every day I know because I built it. I designed the machine to detect suggestions to post ...
1
vote
1answer
3k views

Shopping cart application in Spring MVC

I am creating a shopping cart application to learn Spring MVC. I want to display a list of all categories and subcategories in more than one page. i.e; Home Page, Products page, and Category page. In ...
6
votes
1answer
3k views

Spring configuration without XML is this reality?

We're doing a website for Cardshifter, and now I've converted the plain html files and css into a Spring MVC web application. Here is the typical configuration classes that I used in most of the ...
0
votes
0answers
1k views

Performance increase on Spring integration

I have been running a program to read a file having 6 million rows and validate each line and write the string containing the validation message to an output file. I am using spring integration to ...
2
votes
0answers
162 views

NoSQL-based sequence generator

For my web application I have to generate a sequence of following format: <year><sometext><month><sequence> For example: ...
1
vote
1answer
94 views

Converting a wrapper object to a value object

I have ChannelWrapper and Channel Value Object. I want to convert each and every field of ChannelWrapper to Channel Value ...