Posts by Tiago Ferezin • 1,567 points
76 posts
-
1
votes3
answers182
viewsQ: How to instantiate an Activity with Edittext fields without being automatically selected?
Developing an Android application, I came across a problem, I have an Activity where there are editing fields (Edittext) in xml, and when I instate it, the first Edittext field, is selected and the…
-
0
votes1
answer425
viewsQ: Why isn’t the object being instantiated?
I have a Bean class (Casa.java) public class Casa{ //atribubutos private String parede; public Casa(){ } //getters e setters public void setParede(String parede){ this.parede = parede; } public…
-
3
votes1
answer149
viewsQ: How to transform a String "Caiaaaque" to another String "Kayak"?
I’m developing a system where the user typed a wrong word, and I changed one or another letter of this word to correct, just for the purposes of studies anyway, and I have to go through the whole…
-
17
votes1
answer2610
viewsQ: What is the Adapter standard?
What is and how the Adapter standard works in Java, I am trying to understand this pattern because I will use it in a project.
-
2
votes1
answer3456
viewsA: How to configure Log4j to generate a file in the WEB-INF folder with different dates?
To configure log4j.properties in a Java Web project first you must place log4j-1.2.17.jar in the folder WEB-INF>lib, you must make sure that the Web App Library library [Feltexlog4j] is in the…
-
2
votes1
answer3456
viewsQ: How to configure Log4j to generate a file in the WEB-INF folder with different dates?
I want to generate *.log or *.txt files with different dates (e.g., file-log-22-10-2015.log) within the WEB-INF folder of my Javaweb project I created the log4j.proprieties file as follows:…
-
5
votes1
answer606
viewsQ: How to configure Apache Log4j to write to the Bank through Hibernate?
I am starting to use Log4j from Apache and would like to know how to configure it by XML file to record the logs in the database using Hibernate?
-
1
votes1
answer514
viewsQ: The find() method of my entityManager from DAO Generica is giving Nullpointer, how to correct?
The change of my DAO is like this: private EntityManager entityManager; public void alterar() throws Exception { System.out.println("T encontrada"); System.out.println("iniciando Alterar id: " +…
-
1
votes1
answer188
viewsQ: Vraptor: conflict of routes
I am developing a news system for a client, and I am going through a difficulty, at the moment that I will record the news at the bank, the following message: java.lang.Illegalstateexception: There…
-
5
votes1
answer374
viewsQ: In Hibernate, whenever I change the Entity configuration, do I have to drop the tables in the database?
Example: I have the Person class below: @Entity public class Pessoa { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long idPessoa; private String nome; //getters e setters }…
hibernateasked Tiago Ferezin 1,567 -
3
votes1
answer1148
viewsQ: How to structure Hibernate Entity relationship annotations?
I would like to understand the difference between Hibernate annotations with JPA: @Onetoone, @Onetomany, @Manytomany and @Manytoone from Hibernate, how it works?
-
13
votes2
answers13163
viewsQ: How to make the Genericdao class using Hibernate?
I wanted to know how to make a generic Dao of a project, using Hibernate and JPA in java. All this to not be mounting a DAO as follows for each object that will persist in the bank: public class…
-
1
votes1
answer542
viewsA: How to redirect the vraptor web.xml link to a Controller?
I solved the problem as follows: I created the 404.jsp page that will only redirect to the Controller so: 404.jsp: <body> <div id="errorContent"></div> <script…
-
0
votes2
answers202
viewsA: View . HTML with Vraptor. Is it possible?
Yes, just use it result.redirectTo("/index.html"); or the result.forwardTo("/index.html"); in the same Controller, which will redirect to you, but as @haykou said, it would be more convenient to use…
-
2
votes1
answer542
viewsQ: How to redirect the vraptor web.xml link to a Controller?
I have the following codes below: web xml.: <error-page> <error-code>404</error-code> <location>/error/404</location> </error-page> <error-page>…
-
1
votes1
answer584
viewsQ: How to treat error 404 and 500 in vRaptor?
I have seen tutorial of vraptor4 teaching to put this error in web.xml, to redirect, the following xml code: <error-page> <error-code>404</error-code>…
-
1
votes1
answer465
viewsQ: Breaking net.vidageek.mirror.exception.Reflectionproviderexception error: Could not invoke method, how to fix?
I am in a code where at the moment I run this java method from Htmlunit: // SIMULANDO UM NAVEGADOR WebClient client = new WebClient(BrowserVersion.getDefault()); client.setJavaScriptEnabled(false);…
-
2
votes2
answers711
viewsQ: How to persist the String of an Enumerator in the Database?
I have the following Enumerator: public enum ETipoCasa{ Propria, Alugada, Financiada, Cedida; } And I’m trying to persist in the database the string of this enumerator as an example: Casa casa = new…
-
0
votes2
answers1969
viewsA: How do I check the status code of the server http response in java?
I solved my problem using Webresponse as follows: WebClient client = new WebClient(BrowserVersion.getDefault()); HtmlPage paginaResponse = (HtmlPage) client.getPage("http://www.website.com");…
-
4
votes2
answers1969
viewsQ: How do I check the status code of the server http response in java?
Good morning, you guys. I would like to know how to do in java to check whether the response received from the server was successful or not. Can someone help me with that?
-
1
votes1
answer205
viewsQ: How do I call the intercept() method of an Intercept class, in another project method?
All right, guys? Well, I’m having a hard time and I’d like a little help. I have the following method from my Acessarintercept class: @Intercepts @RequestScoped public class AcessarIntercept {…
-
4
votes1
answer859
viewsQ: How to convert String that contains String quotes even using replaceAll?
I have a String as in the example below String a = "Meu pai é um Grande "baio" de fada"; I want to make it a string like this String a = "Meu pai é um Grande \"baio\" de fada"; how do I do this…
javaasked Tiago Ferezin 1,567 -
3
votes1
answer2487
viewsQ: How does Htmlunit work?
Someone has some example of login of a web system communicating with another, where I will send the user and password to another site and this site will authenticate and give me a feedback if the…
-
1
votes0
answers70
viewsQ: How do I set up Java Httpclient to accept Javascript and Cookies?
I need my Httpclient return to be able to run a Javascript and load cookies inside it, someone knows how to configure it so this can be possible? Grateful
-
1
votes1
answer719
viewsQ: How do I make a DAO standard abstract java class to inherit in dao classes?
I want to make an Abstract Class in Java to use in the Dao classes that I will use in several projects, not to repeat the methods of selection, insertion, deletion and update in all dao classes. I…
-
1
votes3
answers25678
viewsA: What is a Java Bean and what is it for?
Simplifying the form of explanation, the Javabean pattern, is nothing more than the classes that model objects, where, obligatorily, the attributes are declared private, there is a public…