Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Celinio Fernandes

Ranch Hand
+ Follow
since Jun 28, 2003
Celinio likes ...
Google Web Toolkit Eclipse IDE Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Celinio Fernandes

Hi,
I have a very basic and quick question about the use of @ConditionalOnProperty and @ImportResource annotations.



If the condition is not met (that is the module.enable property is set to false in a properties file) then the ConfigA bean will not be loaded but the resources (myconf.xml) will still be imported. Am i right ?

Whether the condition is true or false, the resources will always be loaded. Correct ? Thanks for helping.
6 months ago

Himai Minh wrote:Hi, Celinio,
Can you try to put this ?



How does that help ?? Re-read my question.
6 months ago
Hi,
I am using Spring Boot 2.1.
I have some mixed configuration in my project : XML files and java classes with annotations. We have this current configuration which works :

application.properties :


applicationContext-file.xml :


We want to extract the component values from the spring.profiles.active property since they have nothing to do with the environment :

application.properties :


How can i condition the instantiation of the myserviceimpl bean inside the applicationContext-file.xml ? I can no longer rely on the profile attribute since the spring.profiles.active property no longer includes the values of the components.

Thanks for helping.
6 months ago
We use log4j 2.7.
I upgraded to version 2.8 and i no longer have the error.

Thanks for pointing me out to the right direction
1 year ago
Hi,

Our application is based on the following stack :
Spring Core + Spring Web flow + JSP + servlets + java 8 + JPA 2 + Tomcat 7.
From time to time when we stop the application which is running on Tomcat 7, we get the following error message :



I noticed other people have had this error message when Tomcat stops.
What could be the problem ?

Thanks for helping.
1 year ago
Just to close this thread, I am letting you know that I fixed it.
I used a custom view which extends org.springframework.web.servlet.view.AbstractView.
It has a method streamBinaryDataFromArray which transfers a file to the HTTP client, from an array of bytes.

It now works on both browsers (IE and Firefox). Why the previous way of doing it was not working on Firefox remains a mystery though...

Thanks again for helping.
1 year ago
Thanks everyone for your help.
Well, I should have mentioned the following :
1) the application is based on Spring Web flow so there is a form action method which is called when the user clicks on the CSV button
That method stores the file in the flow scope :



2) there is a servlet which is called and which sends the file to the client (browser). It is the code that I already mentioned :


So it is working on IE 11/ Edge but not on Firefox.

What kind of works is if i add the the following code inside the form action method :



But of course i get the following error when Spring Web flow tries to render the view (JSP) since the response was already sent :




1 year ago
"It does not work"  in that case means :
blank screen, nothing in the logs server-side and client-side (Javascript)

Yeap, there is some JavaScript involved apparently. I just found out.
1 year ago
It is a CSV file.
It is legacy code.
It is a bug and I am trying to fix it.
1 year ago
Hi,
the following servlet works if we want to download a file through Internet Explorer 11  (and Edge) :



imageMimeType equals application/octet-stream

However it does not work with Firefox Quantum.

Any idea what could be missing ?

Thanks for helping.

1 year ago
Hi,
Here is my maven project structure ;

parent module
  pom.xml
agregator module
  pom.xml
  sub-module 1 (has Spring Boot configuration i.e. one class with @SpringBootApplication annotation + application.properties)
     pom.xml
  sub-module 2
     pom.xml
  sub-module 3 (has Spring Boot configuration i.e. one class with @SpringBootApplication annotation + application.properties)
     pom.xml
  sub-module 4 (has Spring Boot configuration i.e. one class with @SpringBootApplication annotation + application.properties)
     pom.xml


I am wondering if merging all application.properties files in a single one would be a good option.  If yes, where should i put it ?  Inside the agregator module/src/main/resources folder ?
Or should i keep a separated application.properties file for the sub modules that use it ? Knowing that it would help if we plan to make each module a microservice since each module would be more independant.

Thanks for helping.


1 year ago
Hi Jeff Friesen,

Congratulations for this second edition of the book.
I am curious to know what is new in this second edition.
Did you add new chapters and/or added content to existing chapters ?

I guess the first edition was a success otherwise this second edition would not have been possible.
Thanks.

Hi  Jeff Friesen,

does your book explain namespaces in XML ? If yes, how long are the explanations ?
How deep do you go into the details ?
I cannot tell from the book preview on the official website https://www.apress.com/us/book/9781484219164#aboutBook

Thanks
Hi,
does Spring Boot wraps/hides/encapsulates exceptions one way or another ?
I get some strange behaviour when an exception is produced.
For instance, in a Spring Boot + JPA project, if i comment out the @Entity annotation

i get the following exception (warning) :

So the exception says the application is unable to build a Hibernate SessionFactory but it does not point out precisely where the problem comes from.

Any clue ?
Thanks
1 year ago
Hi Craig,
congratulations for another edition of the book "Spring in action".
1 year ago