Joe McTigue

Ranch Hand
+ Follow
since Mar 05, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joe McTigue

@ Bear Bibeault ==> Thank you.  
1 year ago
Hi All,

    Any reason you don't have a forum for the programming Language called Kotlin?

Regards,
Joe
1 year ago
I'm trying to create an app which will capture an image, then crop it and resize the result and display it.  
I've already completed the above, but I would like to make it easier for the user by placing a rectangle shaped
target frame over the camera input to help the user aim the camera before they click the picture.
Any ideas, links or suggestions on this would be very appreciated.

Regards,
Joe
2 years ago
Hi Ankit,

I figured out the issue, my code was correct, I had a corrupted jar file in my maven .m2 folder.
I deleted all my .m2 jars and rebuilt them, then tried it again and all works fine now.

Thank you for your time and effort.

Regards,
Joe
2 years ago
2 years ago
Hi Ankit,
The application is working and println is displaying unexpected result in console.
See my notes in original posting for what println is currently displaying in console.
I am opening url: http://localhost:8080/FitnessTracker/addMinutes.html without a problem.
I enter a number and click the button and it takes the number.
then it redirects you to the url: http://localhost:8080/FitnessTracker/addMoreMinutes.html
followed by writing the println to the console.
But the println the error, it should be writting both the println from addMinutes and the println from addMoreMinutes.
but it is only writing the println from addmoreMinutes, that's the issue.
Why is it skipping the println from the addMinutes method, that's what I'm trying to figure out.
Let me know your thoughts.
2 years ago
I'm learning how to use redirect and forward, then testing to see how the output works with a couple of system.out.printlns.
For some reason my console output never prints the
of the addMinutes method of my controller, please help me figure this out.  

currently I'm getting the following output on my console:

INFO: Server startup in 2058 ms
Nov 08, 2016 12:48:34 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'fitTrackerServlet'
Nov 08, 2016 12:48:34 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'fitTrackerServlet': initialization started
Nov 08, 2016 12:48:34 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'fitTrackerServlet-servlet': startup date [Tue Nov 08 12:48:34 EST 2016]; root of context hierarchy
Nov 08, 2016 12:48:34 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/config/servlet-config.xml]
Nov 08, 2016 12:48:36 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped "{[/greeting]}" onto public java.lang.String com.pluralsight.controller.HelloController.sayHello(org.springframework.ui.Model)
Nov 08, 2016 12:48:36 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped "{[/addMinutes]}" onto public java.lang.String com.pluralsight.controller.MinutesController.addMinutes(com.pluralsight.model.Exercise)
Nov 08, 2016 12:48:36 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped "{[/addMoreMinutes]}" onto public java.lang.String com.pluralsight.controller.MinutesController.addMoreMinutes(com.pluralsight.model.Exercise)
Nov 08, 2016 12:48:36 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace 'fitTrackerServlet-servlet': startup date [Tue Nov 08 12:48:34 EST 2016]; root of context hierarchy
Nov 08, 2016 12:48:36 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace 'fitTrackerServlet-servlet': startup date [Tue Nov 08 12:48:34 EST 2016]; root of context hierarchy
Nov 08, 2016 12:48:36 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'fitTrackerServlet': initialization completed in 2002 ms
exercising: 17

I running this in a Java 8 compiler,
using Spring STS version 3.8.1 IDE,
Tomcat version: 9,
Maven version: 3.3.9,
spring-webmvc version: 4.3.2,
servlet-api version: 2.5,
jstl version: 1.2

Here is my controller code:

here is my JSP code:


Thanks for any help you can offer.
Let me know if you need to see anything else.
-Joe
2 years ago
figure this issue out...
Seems my windows installer was corrupted when I installed Norton backup and security.
I had to wipe my c drive and reinstall windows 7 and install dev tools before re-installing security, what a pain.
Anyone know a good brand of security software for internet and virus protection that won't cause problems for windows installer?
2 years ago
Hi,

I'm trying to setup my laptop with java 8's 64 bit jdk so i could get started working with java 8 development on my windows 7 64 bit laptop.
But after downloading the installer from oracle and running the installer, I seem to only have the mouse icon turn to circles for a few seconds and then stop.
No start screen, no nothing.  I tried just double clicking the installer on my desktop and still the same result.
I have Norton Security and backup and these were disabled when I tried the above.  
I've also checked the download size of the installer and it matches the size Oracle says it should be.
I've even deleted the installer and re-downloaded it five times just in case it got corrupted in the download.
Can anyone think of any other reason what I've tried wouldn't work?

Regards,
Joe
2 years ago
Thank you Ikneet Singh,

I really appreciated your description on why and how this works, it really helped me understand the process better.

Regards,
Joe
3 years ago
Thanks Winston,

So the toString() local method is called by default from println() when println() is asked to print the object.
Thanks for explaining this and adding the reference. :-)

Thanks,
Java Joe
3 years ago
Hi All,
I'm trying to understand why the following code calls the local toString() method and not the testMethod()?


This prints out the string "43" as a result.

Even when I change the name of the method in the super class to toFString() it prints out the same returned string?
Why does the local toString() method even get called, I just ruled out it being because the super method had the same name.
...and why isn't it calling the testMethod() as well...???
Any help on understanding this would be greatly appreciated.

Regards,
Java Joe
3 years ago
Thanks Mike, I actually get it now. :-)
3 years ago
So if sb is only a local reference, then why does the following substituted for 'sb = null' affect the original value of sb and the previous 'sb = null' did not?

replace "sb = null" in previous code with:


I appreciate your answers and I am really attempting to understand this in a big way. :-)
3 years ago
Isn't the StringBuilder object mutable?
...and wouldn't that mean the StringBuilder 'sb' reference stays the same?

What would be the difference if you used sb.delete(start, end) instead of sb = null?
3 years ago