Spring is a module based open source framework to build robust Java / Java EE applications.

learn more… | top users | synonyms

2
votes
2answers
86 views

Is it correct to use PUT with multipart content?

We are using Spring and want to implement a REST with a "override file" call so we think using PUT verb with a multipart body only to find that Spring don't accept it. My question is it can't be done ...
-4
votes
0answers
24 views

Grails spring saml configuration [on hold]

I am using spring-security-saml:2.0.0 plugin with serializer-2.10.0.jar, xalan-2.7.1.jar, xercesimpl-2.10.0.jar, xml-apis-2.10.0.jar, xml-resolver-1.2.jar. I am also following the instruction on ...
0
votes
1answer
76 views

REST is not appropriate for business applications because of necessary to distribute business logic accross layers. REST alternative required!

I have Spring+Java Server Faces (Facelets) application for which I would like to create Single Page Application (SPA) version, e.g. using AngularJS (which is the best and most popular GUI framework). ...
1
vote
0answers
18 views

From PreAuthentication to JWTAuthorization

I would like to ask about a problem I have designing a security flow. The context I have a webapp designed in two modules web and server Web: it's a single page client, built with Angular 1.5.5 ...
0
votes
1answer
70 views

Why is a Spring's HttpClientErrorException an unchecked exception?

Oracle summarises the purpose of unchecked exceptions as: The next question might be: "If it's so good to document a method's API, including the exceptions it can throw, why not specify runtime ...
1
vote
1answer
193 views

Logging RestTemplate's responses

I want to log responses using Spring's RestTemplate. At first I thought I should do it using a ClientHttpRequestInterceptor, but since every set of requests should be logged to a different file, I ...
2
votes
2answers
87 views

Client-side Rendering vs JSP's for Spring MVC Front End Dev

Firstly, a note on the app I'm about to discuss: It's quite large, on the order of magnitude of a service app like Airbnb -- i.e., it's not just a static web page, it is a full web application. It's ...
0
votes
0answers
14 views

Visibility into Tomcat & WebApplication ClassPath loads

I am not sure if this is a thing that can be done, or if it is way to dependent on my development environment: Is there a quick way to see which applications are loading in which jar files for class ...
0
votes
0answers
31 views

JpaPagingItemReader : page size and commit interval of chunk

I have questions regarding page size of JpaPagingItemReader and commit-interval of job chunk. As per JpaPagingItemReader documentation, it says "..In order to reduce the memory usage for large ...
5
votes
1answer
85 views

How can I plugin new JARs implementing an interface dynamically?

Quick background: I am working on developing an interface that will be implemented by myself and other developers. This interface will allow users to "plugin" new functional code into a system for ...
0
votes
0answers
44 views

Incorporating external web services in Java/Spring web app

With traditional Java/Spring web apps, I've historically used an JEE architecture where there's a domain tier and a web tier. The web tier mostly contains web controllers. The domain tier includes ...
0
votes
2answers
107 views

Spring-MVC : Testing code by automatically running it in UI

I am working on a Spring-MVC application(config XML based, no Main class) in which I would like to do testing. I have known that there is a way to test code which is backend+frontend code. For that, I ...
2
votes
1answer
51 views

Getting instances without using the Spring context

I'm writing a small game of life implementation with Spring, but trying to avoid referencing the Spring context within my code. I have two interfaces, Board and Cell. In each implementation of Board ...
3
votes
1answer
79 views

where to put methods that manipulate objects

I have a controller method as follow: public class RoomsController { @RequestMapping(method = RequestMethod.GET, path="/v1/rooms/{name}") public ResponseEntity<?> ...
0
votes
1answer
90 views

Synchronisation with offline system

I'm designing a system from which I will synchronise business data from mobile device that have an embedded application that generates datas and send them back to the server. Each line synchronised ...
2
votes
0answers
48 views

Cache updates after not related REST request completes

I am wondering about the following scenario - it's in the land of Spring/AOP and Ehcache. Happens in REST Web Application - REST/Service/DAO layers - I have objects in cache (@Repository + ...
0
votes
1answer
78 views

Conditionally creating objects at runtime using Spring.NET

I have a couple classes in a project I'm working on that only register event handlers. public class EventLogger { public EventLogger(EventRaiser someObject) { someObject.EventRaised ...
1
vote
0answers
94 views

Securing a REST API based on authentication with external site

I have a website with an already-established authentication system. Once a user logs on to it, one of the features is a statistics application based on AngularJS. The app communicates with an ...
0
votes
0answers
53 views

Test Utility in Spring: Singleton or Static

I'm working on Test Utility in a spring project, this utility contains a methods to convert an object to JSON object and vice versa..etc and I'm confused if it's better to make the methods as ...
2
votes
1answer
120 views

Using Spring in Java Project

I've got a question about a correct usage of Spring. I know that some people use the DI "aggressively" so that they always use spring and completely eliminate the usage of word "new" in the ...
7
votes
2answers
166 views

Gradually move codebase to dependency injection container

I have a large codebase with a lot of "anti-pattern" singletons, utility classes with static methods and classes creating their own dependencies using new keyword. It makes a code very difficult to ...
0
votes
1answer
68 views

Spring Consuming Internal REST WS for MVC

Sorry in advance if this is a little confusing, it's difficult how to phrase this. I am currently using Spring MVC with some RESTful services mixed in for some AJAX client side logic. I am looking ...
2
votes
0answers
25 views

Approach for querying an arbitrary set of user submitted fields and values in Spring application? Like a shopping site sidebar search?

I am working on a Spring Boot and Angular application which has a requirement to search based on any number of the available filters being applied to a list. For example, a user searches on 'Title' ...
0
votes
0answers
59 views

Implementing logging interceptor next to BeanPostProcessors and BeanNameAutoProxyCreator

I want to implement simple mechanism based on annotation on method in different classes. The case is, that I have some beans created as a proxies with transaction interceptors like this: <bean ...
3
votes
5answers
293 views

In which layer should validation be located?

I'm creating a Rest API using Spring Boot and I am using Hibernate Validation to validate request inputs. But I also need other kinds of validation, for example when update data needs to checked, if ...
2
votes
1answer
182 views

Using prototype/non-Spring managed beans in Spring Web application

I have been working on few web applications/REST web services recently (Spring IoC/MVC/Data JPA etc) and they usually follow the same pattern: Controller classes --> Service classes (which have number ...
2
votes
0answers
61 views

Camel/EIP/ESB with messaging from a website to process an order; synchronous and asynchronous

I am investigating Camel for connecting various services. I understand the core concepts but I was curious about more specific implementation details. This application would have a browser client ...
1
vote
2answers
133 views

Testing using mocking, must I mock all dependencies too?

I have the following method to test: public List<MarkId> getMarkIdList(ICar carDoc) { ICourseCar courseCarDoc = courseCarRep.get(carDoc); List<MarkWag> markWagList = ...
3
votes
1answer
113 views

Spring Batch + Web Scraping

I need to develop a batch processing that will be executed every day. These are the steps: Read each line of a database table that contains a URL (SQLite) Extract some data, say Users, from that ...
15
votes
4answers
1k views

Why do we need frameworks for dependency injection? [closed]

I've been reading up more on the Inversion of Control principle and Dependency Injection as an implementation of it and am pretty sure I understand it. It seems to be basically saying 'don't declare ...
0
votes
0answers
68 views

Spring pass-through authentication mechanism

I want to implement a "pass-through" authentication system using Java and Spring. I want to create a service that will be transferring all incoming http requests to a different host/port where ...
0
votes
2answers
262 views

Spring StoredProcedure Inject declared parameters or not?

At work one of my colleague asked to me to change the way a Spring StoredProcedure subclass class was initialised from injecting the parameters with Dependency Injection mechanism (Constructor ...
2
votes
1answer
241 views

Usage - Factory Pattern vs Dependency Injection [closed]

Okay, this question is not on which is better. It is more about when to use Dependency Injection vs Factory. I have done a bit of research and it goes like this. DIP: Provides loose coupling, ...
3
votes
2answers
893 views

Why Java does not have a framework like Rails? [closed]

I am a Ruby on Rails developer and I like its simplicity and rapidness. On the other hand we need to use Java for some projects that we develop for our clients. My question is why (pure) Java does ...
2
votes
2answers
106 views

What is a transaction?

When reading Spring tutorials I'm quite often coming across the @Transactional annotation. When I google it, I get documentation that says things like: Comprehensive transaction support is among ...
1
vote
2answers
262 views

What should be the best way to run a long operation in Java Spring?

I am working on a price comparator, one of the module of application crawls through the list of website against the product stored in the database and updates the price in the application database. ...
3
votes
2answers
330 views

Is it still a good practice to log parameters and returns?

Just a context, I am currently making a base code for a Java Spring Boot Application. I am currently setting up the logging of the application and I stumbled upong this url and found it helpful. ...
2
votes
1answer
198 views

Injection, strategies and OO

I'm working on refactoring a project. The business logic looks very much like using the Strategy pattern would be very beneficial, because depending on the values of three properties (let's say age, ...
0
votes
0answers
86 views

Is it possible to define injection rules based on Spring bean scopes?

My application is using Spring as my dependency injection framework. I have been struggling recently with nasty concurrency and security bugs. The bugs were caused by injecting bean with incorrect ...
1
vote
1answer
85 views

Using session managed application environment vs no protection

First of all sorry for the title, I didn't know how to explain it. So here comes the story; We are bunch of coders, front-end and back-end, and we are going to create this new system, based on ...
1
vote
2answers
75 views

Application model management questions

Consider the following type of Java / Spring web application, with an SQL database: there are multiple data entity types (about 100) with relations between them the entities are viewed, edited or ...
0
votes
1answer
1k views

What is the usefulness of transactions in a batch (especially a Spring batch)?

I understand what a transaction is in a web application, where you have some groups of database interactions which have to fail or succeed together so the database is always in coherent state. But ...
0
votes
1answer
217 views

Can I ditch the persistence.xml file on JBoss?

I have a Spring based app where another programmer is using JPA's persistence.xml file to define the setup of hibernate and to define the entities that are being persisted. The app is using Spring's ...
1
vote
0answers
59 views

Where should business logic involving SQL go? [duplicate]

I have this question that's been bugging me all day. I have a function like this: public void voidUsersByUserId(List<Integer> userIds) { Query query = ...
2
votes
2answers
242 views

How to add rigor to my testing?

I work on a small/medium sized Java application. Over time, I've tried to ensure that the tests which I write are "good" tests, and that there's plenty of them. Hence I've been looking into various, ...
0
votes
0answers
613 views

Are prototype beans with constructor parameters an anti-pattern?

Reading on this, Misko Hevery has said “Newables can ask for other Newables in their constructor, but not for Injectables” Now it appears to me that requesting a prototype be instantiated at run-time ...
4
votes
2answers
2k views

Programmatically extending Hibernate table/entity definitions in Spring, how?

I would like to know if there is a way —maybe with AOP— to extend table/entity definitions so that I can add functionality across the board that requires persistence. Let me explain what I want to do ...
1
vote
0answers
37 views

Is there a way to handle shared javascript assets in Spring?

I'm familiar with MVC web frameworks and lately very familiar with Symfony2. I want to start learning Spring, and the first practical problem I would like to try to solve is handling the reuse of ...
1
vote
1answer
101 views

Duplicate method in spring services, how to refactor?

ServiceOne.java private void doStuff(){} ServiceTwo.java private void doStuff() Where to put common code ? Shall I create a new service, but then what interface will it implement ? Or shall I ...
2
votes
1answer
2k views

Issues about static injection in Spring?

I use spring-boot with spring xml in my project. I wrapper the DAOs in a DataAccessService class to serve as a DB service layer, both the service and the DAOs are injected in spring xml and used by ...