Posts by DiegoAugusto • 8,694 points
325 posts
-
0
votes1
answer63
viewsA: User see only Items of the Operational unit that is in your registration
Well, I think the problem is in your UserStatic. From one that I took from a reply of @utluiz: Static attributes: Static attributes have the same value for all the instances of an object (within the…
-
2
votes1
answer107
viewsA: "Error" CRUD Hibernate JAVA
This problem is happening because you are not going to Chave Primária of your Time that is already registered. That would solve your problem: Time t = new Time(); //Id do Pernambuco que é a chave…
-
1
votes2
answers721
viewsA: Save $Scope from page with Angularjs
As already said you can use the SessionStorage or LocalStorage. Angular already has a library that facilitates the use of both: ngStorage All you need to do is save your filter to one of the two and…
-
0
votes1
answer844
viewsQ: Set path to save files to Linux
I have a Back-end done in Java where I get some files from the front and save them to a folder. This system ran on a server Windows with Tomcat but recently the same had to be migrated to Debian. In…
-
2
votes1
answer397
viewsA: Difference between two arrays with Typescript or ES6
I solved the problem as follows: let mapChamada = chamada.map(item => item.Matricula); let mapPessoa = pessoas.map(item => item.Matricula); let diff = mapChamada.map((Matricula, index) => {…
-
2
votes1
answer3497
viewsA: Display data in modal by angular ui
Since I haven’t seen your full code, I’m not sure yet, but come on. In this example we have two Controllers, one is only responsible for Modal. Note that in the same way that you return the client…
-
0
votes1
answer397
viewsQ: Difference between two arrays with Typescript or ES6
How can I get the difference between two Arrays of objects using TypeScript or ES6? I tried to do using SET: let arr1 = new Set(lista1); let arr2 = new Set(lista2); let difference = new Set( [arr1…
-
7
votes1
answer1580
viewsA: How to Set Up Multiple Web API Get
I didn’t quite understand, but yours GET with the optional parameters can be this way: [HttpGet,Route("api/Pessoas/ListarFiltrados")] public IHttpActionResult ListarFiltrados(string? Nome= null,…
-
1
votes1
answer796
viewsA: Doubt with webservice put and delete method. How to implement in java?
There are some frameworks that facilitate the development of webservices in java, one of the most popular is the Spring. Example of PUT and DELETE with Spring: @RequestMapping(value = "/user/{id}",…
-
0
votes2
answers149
viewsA: How to pass an Angular Js and Ionic dependency
Note that you are injecting the library into the name of your module, missed separating the two parts with a comma. angular.module('myApp', ['ui.filters']) .controller("papaRoca", function($scope,…
-
2
votes2
answers7717
viewsA: Execute a function when loading the page, Javascript and Angular
You can call your function within itself Controller, that way it will be called as soon as the page opens. EX: angular.module('myApp', []); angular.module('myApp') .controller('myCtrl',…
-
1
votes1
answer1974
viewsA: Success message, Javascript and Angular
You can use the library angular-Growl which is pretty cool. Example: angular.module('myApp', ['angular-growl', 'ngAnimate']); angular.module('myApp').config(['growlProvider', function…
-
1
votes1
answer1094
viewsA: Share object between two controllers in Angularjs
There are some ways to get the result you want, how to use $rootScope, $broadcast or store the data in SessionStorage or LocalStorage, etc.. One of the simplest ways is to create a Service to share…
-
4
votes1
answer1124
viewsA: How to filter with ANGULAR JS not to repeat equal names?
You can use the Angularui to solve this problem. Example: var myApp = angular.module('myApp', ['ui.filters']); function MyCtrl($scope) { $scope.names = [{ id: 1, Name: 'Diego' }, { id: 2, Name:…
-
2
votes1
answer123
viewsA: Problem when trying to connect to a Signalr+Angularjs Hub
I solved the problem by referencing the hub path before start. var hub = $.connection.myHub; $.connection.hub.url = "http://localhost:5702/signalr"; $.connection.hub.start().done(function() {…
-
5
votes1
answer123
viewsQ: Problem when trying to connect to a Signalr+Angularjs Hub
I have a little project with WebApi,SignalR and Angularjs where I do some queries and inserts in real time. Everything works fine when I start the file index.html right when running the application,…
-
4
votes1
answer331
viewsQ: Right Way to Make Relationship One To Many Using C# and Mongodb
I have two entities, Sistema and Comentario where a system can have several comments: public class Sistema { public ObjectId Id { get; set; } [BsonElement("SistemaId")] public int SistemaId { get;…
-
1
votes1
answer129
viewsQ: Save uploaded data from a partialView
I have a PartialView with BeginCollection where I upload a list of products to Dropdowns dynamic: In this project I have a relationship ManyToMany between Product and Supplier where I have the…
-
3
votes1
answer216
viewsQ: How to return a message together with an Httpstatuscode
I have the following method in my Controller: public IHttpActionResult Get(string id) { var product = objds.GetProduct(new ObjectId(id)); if (product == null) { return NotFound(); } return…
-
1
votes1
answer66
viewsA: Fill Serie xls with java POI
Come on, if I understand correctly you want to pick a date and increment 1 day each time you pass the loop, ex: 10/02/2012 11/02/2012 12/02/2012 For that you can use the Classe Calendar to add days…
javaanswered DiegoAugusto 8,694 -
1
votes1
answer281
viewsQ: Delete created entity from a Manytomany relation
I have a relationship ManyToMany amid users and profiles mapped with Hibernate: user: id name profile: id profile_name user_profile: user_id profile_id The mapping is done as follows: User:…
-
0
votes1
answer250
viewsA: Creating a "check" method in a DAO class
I don’t understand very well, but if you want to check if a particular user already has an open order you can do the following: public int verificaStatus(Usuario usuario) { int id = 0; Connection…
-
2
votes2
answers4608
viewsA: SQL - How to select or delete a column with value equal to null in a query select
Instead of using campo = null try to do it that way: WHERE campo IS NULL In the Mysql this expression tests if the field is null. To do the reverse just use the IS NOT NULL. See working on Sqlfiddle…
-
1
votes2
answers37
viewsA: Error inserting data into table
The problem is in the name of your table. Note that you are putting an integer value as a name. If you try to run the query directly into a SGBD may come the error message with more details. Try…
-
3
votes3
answers2889
viewsA: Get Defined/Current Time Difference
You can use the library Moment js. and do something like this: var today = moment("Tue May 23 2016 09:00:00 GMT-0300 (BRT)"); var day = moment("Thu May 19 2016 05:00:00 GMT-0300 (BRT)"); var duracao…
-
3
votes2
answers681
viewsA: How to disable button after sending message?
You can try it this way: //Controller $scope.disableButton = false; function myController(){ $scope.disableButton = true; //Requisição .... //Após o fim da requisição disableButton volta a ser false…
-
4
votes1
answer34
viewsA: I am trying to list data from my database, more precisely from the Cpf column, but I can only bring a data
You need to instantiate your object within the While because this way you will create a new object before putting it in a list. In your FOR you need to use the instance variable that was created in…
-
2
votes1
answer435
viewsQ: Hide Tomcat version on error pages
I have a API Rest running on a server Tomcat. If I try to directly access the API and some error happens to the error page of Tomcat is displayed: Notice that at the end is the following passage:…
-
5
votes1
answer1981
viewsA: How to Import Maven Project to Eclipse Luna
Go to File > Import > Maven > Existing Maven Projects. Then just choose the directory and mark the pom.xml…
-
13
votes1
answer546
viewsQ: Filter locations in an area of X km
I am trying to set up a small project where I have a list of locations and can filter them according to a x km amount. Ex: Filter all places within a 5km radius of my current location. I have a Json…
-
0
votes3
answers657
viewsA: Display values with angular
The problem is that you are using [] in the value. You’re doing it this way: [{value.sigla}] The correct thing would be to use {{value.sigla}} Example: http://jsfiddle.net/81t6cbjw/25/…
-
0
votes0
answers200
viewsQ: Problem setting value of a mysql BIT field
Use Java + Hibernate in my systems, I created an attribute boolean to determine whether a user is an administrator: private boolean isAdmin; The Hibernate generates tables and fields, and this isAdm…
-
0
votes1
answer66
viewsQ: Problem with SUM in Namedquery
I have the following NamedQuery: @NamedQuery(name = "Controle.listarTotais", query = "SELECT controle.prestador, controle.tipoPrestador, SUM(controle.valorLote), SUM(controle.valorPago),…
-
2
votes1
answer278
viewsA: Download with 5.3 primefaces after 5.1 migration does not work
According to the documentation of Primefaces you must set the Ajax property of the button to false ajax="false" Basically ajax in the commandButton specifies how the Submit of the page will be done.…
primefacesanswered DiegoAugusto 8,694 -
1
votes2
answers1034
viewsQ: How to pass an array that is in the controller to a directive
I have a directive where I mount some graphics, but I’m not getting to understand how I can pass a Array of controller for this directive or so how can I catch this Array using $http within the…
angularjsasked DiegoAugusto 8,694 -
2
votes3
answers204
viewsA: Get function in service.js returns null
As already answered you need two For's one to go through categories and another to go through products. Alternatively you can use angular.ForEach() to walk theirarrays: var myApp =…
-
28
votes3
answers17504
viewsQ: What is the purpose of Transient and Volatile in Java?
Sometimes when I declare my attributes I notice the transient and the volatile. I have the following doubts The transient and volatile are access modifiers? What is the purpose of using them?…
-
8
votes1
answer5127
viewsA: Convert String to Float with Java comma
One of the ways I know is by using Numberformat: public static void main(String[] args) { String numero = "199";…
-
0
votes1
answer1338
viewsA: Help with Mask Directive for 4 decimal digits in Angularjs
You can use the library ng-currency, with this library you can format your decimal places. Here is a simple example of how to use the library.…
-
2
votes1
answer3848
viewsA: How to disable field and button in Angularjs?
You can create a boolean variable to address this problem. Ex: $scope.disableButton = false; At the beginning of the function enviarMsg you arrow the variable as true: $scope.disableButton = true;.…
-
3
votes2
answers344
viewsA: $Http Which one should I use?
Use the then as @lbotinelly said success and error are deprecated. $http.get('https:url/exemplo.json') .then(function(response) { return response.data; }, function(err) { console.log(err); }); Is…
-
2
votes1
answer692
viewsA: Communication between two Angularjs controllers
I solved the problem with the help of @lbotinelly, as the same told me, all access to the service will always initialize the object and an alternative would be to use the localStorage. In the first…
angularjsanswered DiegoAugusto 8,694 -
2
votes1
answer692
viewsQ: Communication between two Angularjs controllers
I have an object I’d like to share with others Controllers, thought of two ways, the first would be to use $rootScope and in the other use a Service. I chose the second way and created the following…
angularjsasked DiegoAugusto 8,694 -
0
votes1
answer2734
viewsA: ng-value with 2 values and 2 ng-model in the same input-radio
Why don’t you pass the entire object in value and then manipulate it in the controller? It would be more or less like that in Angularjs: var myApp = angular.module('myApp', []);…
-
2
votes1
answer106
viewsA: Dynamic graphical user interface after Mysql request
Your code is very disorganized, I recommend putting each query related to Employees in methods. Here is a simple example of how to pass Cpf as a parameter in a query, try to adapt as your need.…
-
0
votes0
answers34
viewsQ: How to use Salt correctly with MD5
I’m using Apache Commons Codec to encrypt system users' passwords. Ex: DigestUtils.md5Hex(usuario.getSenha()) The problem is that depending on the password it can be easily broken, so I thought to…
-
0
votes1
answer347
viewsA: Error calling REST with Angularjs
Try creating a filter to work with CORS: import java.io.IOException; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerResponseContext; import…
-
5
votes2
answers1327
viewsQ: Would it be feasible to save session user data in Sessionstorage?
Save user data to SessionStorage is a good option? For example, the user enters with the login and password I do the authentication on back-end and return the entire object, then store that user in…
angularjsasked DiegoAugusto 8,694 -
3
votes1
answer49
viewsA: Problems with the Hibernate update
The @NotNull validates only in the system as it is part of the specification of the Bean Validation, if you do not want the null bank field then you can put @Column(nullable = false) which is the…
-
1
votes3
answers350
viewsA: Data of an Array
An alternative would be to create a filter to display only unique values. Ex: var myApp = angular.module('myApp',[]); myApp.filter('unique', function() { return function(colecao, campo) { var saida…