Skip to main content

Questions tagged [spring-mvc]

Filter by
Sorted by
Tagged with
0 votes
0 answers
224 views

better structure of a software project to prevent circular dependencies

I am contacting you today regarding a recent problem with circular dependencies. It's about a Spring boot application that accepts data via a Rest API and then forwards it to an internal Spring ...
Phoenix's user avatar
  • 67
0 votes
1 answer
80 views

I don't understand how to characterize a class similar to a DTO but with validation

I have the entity class. @Entity public class User { @Id @GeneratedValue private long id; private String name; private String lastname; @Column(unique = true) private ...
CalmPerson's user avatar
0 votes
3 answers
2k views

In which scenarios is server-side rendering is better choice than the front-end JS libraries like React, Vue, Angular etc.?

As a Java developer, I just have scratched the surface of Javascript libraries like React, Angular, Vue etc. It seems that theoretically any web applications with server side rendering, like Spring-...
Rui's user avatar
  • 1,909
1 vote
1 answer
10k views

Is it okay to have one Service with two different Repositories in Spring Boot MVC?

I have a backend Spring Boot API that should have one(?) endpoint that returns some statistics to display in a frontend. These statistics are calculated from data that comes from two different ...
Mr. Phil's user avatar
  • 119
0 votes
1 answer
101 views

Where Should You Add a Shared Maven Module as a Dependency in an N-tier Architecture

In a simple web architecture using Spring and Maven where it consists of following layers: Controller Service Repository Shared Where in shared module all the classes that are used among different ...
NuCradle's user avatar
  • 175
1 vote
1 answer
926 views

building a frontend for a microservice backend: architectures? (spring boot stack)

to summarize a bit my current situation: I am building a backend based on microservices using spring boot. These are aggregated behind an api-gateway. My intention is to consume these api's from both ...
aquilares's user avatar
  • 131
2 votes
1 answer
151 views

What should I name this area of my architecture?

I am developing an architecture for a new MVC system. The legacy system has a layer it calls "facade", but it is not the classic GoF Facade. It is more like a service aggregator. It is used as a ...
jkilgrow's user avatar
  • 147
-2 votes
1 answer
266 views

Property file, annotations or database tables for storing configurations

Which one is better property file, annotations or database tables for storing configurations related to a program? What are the advantages/disadvantages and what use cases are best suited for each ...
Rajat Sharma's user avatar
1 vote
1 answer
780 views

JHipster generated endpoints adds header messages

I'm adding new functionality to an existing application it was done using JHipster. I've notice that some endpoints follow this pattern: return ResponseUtil.wrapOrNotFound(updatedUser, ...
Traufvihal's user avatar
-1 votes
2 answers
93 views

User friendly webapp configuration

I'm planning to develop a web application that would run on-premise at the customer. I'm quite unsure about the whole process of setting up the site in a user-friendly way, but mostly disturbed by the ...
Peter's user avatar
  • 226
1 vote
1 answer
201 views

Spring Boot Controller Unit Test Strategy

All of the controllers in our project are as dumb as we can make them. Rightfully so, they simply validate the incoming payload, hand the request over to a service layer, and return whatever response ...
Gregg's user avatar
  • 111
2 votes
1 answer
2k views

Handling an empty path variable request

I have a scenario where I can take a student Id as input via a part variable and return some data back as JSON objects where JavaScript handles the response as a part of AJAX call. Suppose the method ...
user1369975's user avatar
  • 1,299
2 votes
1 answer
481 views

Strategy to deal with huge data

I have a Spring based java webservice which is returning JSON response. The problem is that the JSON response takes long time because the SQL involved is querying huge chunk of data and it takes 4-5 ...
John's user avatar
  • 161
1 vote
1 answer
1k views

Where to store static contents

Recently I am developing a new feature for my web application that must be Release Independent. The feature requires to show some predefined data. Those data will rarely be changed or updated. Here ...
Erfan Ahmed's user avatar
8 votes
1 answer
7k views

Implementing a REST API in a Clean Architecture

I have been implementing a proof of concept application using Uncle Bob's Clean Architecture and I have run into a bit of a problem. Uncle Bob's architecture calls for the explicit separation of ...
Carlos's user avatar
  • 83
5 votes
1 answer
709 views

IEC 62304, Are Software Frameworks (Spring/JEE/Angular/React) considered SOUP?

Im working on the implementation of an IEC 62304 compliant development process in our company and I have a question considering SOUP (Software of unknown Provenance). Our goal is the develop a web ...
TardigradeX's user avatar
9 votes
1 answer
14k views

Data Objects for each layer(DTO vs Entity vs Response objects)

Let's say I'm building a Customer web application(in Spring Boot 2), which also exposes rest end points. I'm modeling my application into 3 layers. a) UI - CustomerDTO b) REST - ...
Sandeep's user avatar
  • 199
0 votes
1 answer
249 views

Support i18n in existing application?

I have java/spring based web application with front end in JSP/HTML/JS/Jquery. We already have spring based i18n support. In JSP labels are coming from property files. html/browser download the ...
user3198603's user avatar
  • 1,896
7 votes
2 answers
7k views

Localization (i18n) with Spring boot with data in database

I am writing a Spring boot app with Thymeleaf, which should support two languages (or more). I have set up the locale resolver and messages.properties so now my app can translate static messages on ...
Miha Jamsek's user avatar
4 votes
1 answer
2k views

Why do we use redundant CRUD methods in service and persistence layers?

I read few sentences of this. I understand that simply put, the persistence layer (with its repository objects) deals with basic data access CRUD. The service layer on contains business logic. In my ...
Jason Krs's user avatar
  • 179
4 votes
1 answer
4k views

DTO can be considered as Business objects (with behavior)?

Based on this Question and its answer : Object in Business layer same as DTO with logic? I want to ask : What if instead of DAL, I'm getting data from a remote service (API) through DTOs. My ...
Mohamed Amine Mrad's user avatar
0 votes
1 answer
711 views

What are architectural approaches for converting large multipage apps to use new JavaScript frameworks?

We have many siloed legacy multipage applications. For example, a personal information collection application may contain four or five HTML4 form based applications. The backend is based on Spring ...
berlinbrown2's user avatar
2 votes
1 answer
1k views

Is the Model in Spring MVC the same of MVC pattern?

Studying some in-depth concept of Spring framework, I'm facing this doubt. Has the Model, as inteded in Spring MVC, the same meaning of the M in MVC? I mean: I always considered the Model of the MVC ...
davioooh's user avatar
  • 199
5 votes
6 answers
3k views

Allowing users to add their own custom fields in a Spring MVC Hibernate application - What's an ideal approach?

We all may have seen applications like JIRA, or many CRM or other applications that allow its users to define their own custom fields to an entity, and do a variety of stuff with it, like making them ...
Sriram Sridharan's user avatar
3 votes
0 answers
73 views

How to wireup the Edit Functionality of a Entity and make REST API when it contains Dropdown Values

I am having a scenario wherein we have a Product Entity or a Front End Module which can be Added, Edited and Deleted. Now Product ( when added or edited) can contain a Dropdown called as ...
Mitesh Manani's user avatar
4 votes
2 answers
2k views

Spring MVC - Handling validation errors using AJAX

I'm new to Spring MVC, hence the question may appear trivial. I have a login form which is submitted via ajax and in return I receive a ModelAndView (displaying existing list of contacts of the user) ...
Abhigyan Mehra's user avatar
2 votes
1 answer
383 views

Advantages and disadvantages of building web app purely with microservices and hybrid with web framework

Definition: Purely microservice: Not using any web framework such as Spring, Laravel, Zend, Django. Web app is a single page app loading data via Ajax calls to web services Hybrid: The web framework ...
InformedA's user avatar
  • 3,021
2 votes
2 answers
3k views

Should Microservice still use web framework such as Spring

My understanding of Microservice architect is that much of the work is shifted to the front end client side in a single page application (SPA). The SPA will then interact with the back end ...
InformedA's user avatar
  • 3,021
2 votes
1 answer
3k views

Handling validation/exception responses in rest-ful app

So I am facing a problem with handling all sorts of exceptions within spring-boot application. Basically project is structured: back-end (services, repositories) <----- RestControllers <---- UI ...
Xeperis's user avatar
  • 121
4 votes
3 answers
2k views

Version-postfixed class name for REST api

I'm working on a Spring-based REST api that has v1 and v2 variants: /api/v1/dates /api/v2/dates Correspondingly, there are v1 and v2 packages in the code base: com.company.api.v1 com.company.api.v2 ...
GJ.'s user avatar
  • 149
1 vote
1 answer
122 views

Details of how model implemented in Spring MVC?

It seems to be the view and controllers are rigidly defined, but the model is highly nebulous. For instance, views go in views folder, controllers have the word controller in their name and have ...
Wes's user avatar
  • 129
1 vote
2 answers
1k views

Web Application Architecture review and understanding

I'm an amateur java developer and I have been working on this web application in my current company. The application is made in the Spring MVC framework. Hibernate is used as the ORM tool while the ...
Aditya Cherla's user avatar
0 votes
1 answer
818 views

Is it a Good Idea to use REST API from Javascript Code

I am Developing a E-Commerce Web Application as a part of my learning using Spring Hibernate and AngularJs. I have written some Rest API's Controllers in Spring and then from the Web Component i am ...
Mitesh Manani's user avatar
5 votes
2 answers
26k views

What is the recommended way to handle exception in Spring MVC

I have a Spring application, where we make few service calls to fetch data. There is a Data Layer in between the Controller and the Service layers. Controller (Request-Mapping) -> Data Layer -> ...
Abhigyan Mehra's user avatar
1 vote
0 answers
92 views

Creating duplicate instances of objects for timeline functionality

I am working on a Spring-MVC based project, in which I would like to add Timeline functionality. The most important object in our project is the Note, there are objects associated with it like ...
We are Borg's user avatar
0 votes
1 answer
6k 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 ...
Walls's user avatar
  • 233
2 votes
2 answers
4k 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. ...
Tushar's user avatar
  • 121
3 votes
1 answer
4k views

Using Websocket for a multiple-page website

Is using Websocket (in particular, in a Java, SpringMVC webapp, with the Spring Websocket support libs, but the question probably applies to any language) for a multiple-page website a bad idea ? I'...
niilzon's user avatar
  • 133
5 votes
2 answers
2k views

Simple and Composite transactional services: Question about separation of concerns and transactions

I believe I know the answer to this but I'm looking for any holes or anything I may be missing. This is focused on Spring and Java but could really apply to any programming stack. Anyway, we have a ...
cbmeeks's user avatar
  • 411
3 votes
1 answer
6k views

Object in Business layer same as DTO with logic?

Let's say I have a Spring MVC project, in which I'm using DTO to get data from a database and to pass data to the UI. Let's suppose that I have a UserDTO and in my business layer I have to do ...
Luke SpringWalker's user avatar
0 votes
1 answer
1k views

Spring web application deployment infrastructure

I'm interested in hearing out what's out there in terms of tips and tricks on deploying and maintaining a Java web application whilst keeping agile. I'm running solo on a startup project I'd like to ...
Matthew Cachia's user avatar
5 votes
1 answer
4k views

Avoiding Double POST

We are implementing a RESTful webservice that will allow client applications to POST documents to it and it will store the document returning a unique identifier in the response. The clients will ...
Paul Croarkin's user avatar
3 votes
2 answers
541 views

blurry lines between web application context layer, service layer and data access layer in spring

I'll admit I'm a spring newbie, but you can correct me if I'm wrong, this one liner looks kinda fishy in a best practices sort of way: @RepositoryRestResource(collectionResourceRel="people"...) ...
thenaglecode's user avatar
2 votes
0 answers
259 views

Is it realistic to test web application with tomcat while production server are using WebSphere?

In our company we use WebSphere Application Server to hold web application but it is not available for developers because of license issue. We have been using Tomcat to test the web application and ...
lamwaiman1988's user avatar
8 votes
1 answer
6k views

Passing multiple errors back from service layer

I am using Spring for a web application. To validate a user's input in a form such as for creating a Person entity I use JSR 303 validation to check for not null/empty or valid patterns etc.. Some ...
Goose's user avatar
  • 195
82 votes
6 answers
164k views

Service layer vs DAO -- Why both?

I have been working with SpringMVC, Hibernate, and some databases in a java web application example. There are a few different ones that do this, but this Spring 3 and hibernate integration tutorial ...
Jeff's user avatar
  • 1,844
1 vote
1 answer
4k views

RequestContextHolder.currentRequestAttributes() and accessing HTTP Session

Need to access HTTP session for fetching as well storing some information.I am using Spring-MVC for my application and i have 2 options here. User Request/ Session in my Controller method and do my ...
Umesh Awasthi's user avatar
6 votes
1 answer
277 views

What would be the market life of a JVM based software framework? [closed]

I saw how Struts 1 lasted from 2000 to 2013. I hear that people are moving from Struts 2 to Spring. But for a project that may need to be maintained for a decade or two, would it be advisable to opt ...
Nav's user avatar
  • 1,183
1 vote
0 answers
890 views

How to integrate google search results in a spring mvc app

Here's what am trying to do (and searching for similar hasn't shown any results anywhere): On my website - provide an input box which will search google for results. I want to display those results ...
happybuddha's user avatar
5 votes
1 answer
3k views

How can I scale spring application context?

I'm currently working on a project that need to be dynamically scaled on demand according to the need. My question is about scaling spring context. My web application has a classical multi module ...
Zenithar's user avatar
  • 305