Questions tagged as 'java'

2
answers

sending email in java does not show the error when it can not send the same

I created a system where the user himself registers and the password is sent by email. If you can not send the email, it generates an error and does not create the user, notifying the user. It was working while you were using your own mail serve...
asked by 08.03.2017 / 15:12
1
answer

How to know the number of possible occurrences found by the group () method of the Matcher class?

After the question " Why did the Matcher class not return the number of groups correctly? , it was explained that the groupCount() method actually returns the number of filter groups in the regular expression, and in question" a href="htt...
asked by 03.10.2017 / 03:44
1
answer

Differences between listeners and adapters in swing

When programming graphical interfaces in Java using swing , we are always faced with both types, mainly to assign and create events from button actions or other components. Although I've been working with swing for some time, I'v...
asked by 19.02.2016 / 22:49
2
answers

Error in JSP include

I have the following situation: Servlet instantiated at root / MinhaServlet Jsp instantiated in a folder inside the root:    /folder/file.jsp Within this file I have the following <img src="_img/editar.png"> <a href="_...
asked by 13.08.2015 / 14:22
1
answer

java.lang.UnsupportedClassVersionError: Unsupported major.minor version 52.0 when running JAR

I have a project in NetBeans and I have to pass it to test for other users. I'm running it on Ubuntu 14 and running the following command to run .jar: java -jar "TesteTableYasc.jar" However, trying to run the .jar file gives Java version...
asked by 09.11.2016 / 20:46
1
answer

User without access to mapped resources in Security-role of web.xml

What is the behavior of security-role of web.xml when user is not allowed access to project resources? Is the weblogic default to return a 404? Is this status configurable? Is there a possibility that when security identif...
asked by 24.08.2017 / 16:46
3
answers

Unit test with the database

I have an application that uses JPA 2 with Hibernate behind and for unit tests, I use HSQLDB in memory with JUnit 4.11. The HSQLDB is configured in a persistence.xml file in a META-INF folder. My question is: How do I upload the clean databas...
asked by 13.12.2013 / 01:06
2
answers

Why is this loop "for" not infinite?

public class Loop { public static void main(String[] a) { int cont=0; for (int i=0; i>=0; i+=2, cont++); System.out.println("cont:"+cont); }} I was struck by the condition of the loop for i>=0 . At the time I thought: loop infini...
asked by 31.08.2018 / 21:04
2
answers

Object Comparison

The code below generates a false , but the objects have the same attribute values, is there any method that compares the objects, but their attributes, not the object itself? Produto P5 = new Produto(1, 0, 10,1000.0,"Samsung","smartphone...
asked by 08.02.2014 / 19:10
3
answers

How to display the exception message (ex.getMessage ()) thrown by the server in a jquery ajax?

@GET @Path("boleto/{processo}/{resposta}") @Produces({ "application/pdf","application/json"}) public Response gerarBoletoDividaAtivaComCaptcha(@PathParam("processo") String numeroProcesso,@PathParam("resposta") String resposta ) throws DetranExce...
asked by 14.02.2014 / 11:25