Skip to content
Advertisement

Checking if a date exists or not in Java

Is there any predefined class in Java such that, if I pass it a date it should return if it is a valid date or not? For example if I pass it 31st of February of some year, then it should return false, and if the date exists then it should return me true, for any date of any year.

Does Java IO have a maximum file name length limit?

Different operating systems have different file name max lengths. Does Java have any limit on file name length when working with files? Answer Java has no maximum file name length, except obviously for the String max length limit (which is the array max length, i.e. Integer.MAX_VALUE). Maybe some JVMs have a lower limit but I never run into such a

how to start stop tomcat server using CMD?

I set the path for the tomcat and set all variables like JAVA_HOME=C:Program Files (x86)Javajdk1.6.0_22 CATALINA_HOME=G:springworkserverapache-tomcat-6.0.29 CLASSPATH=G:springworkserverapache-tomcat-6.0.29libservlet-api.jar;G:springworkserverapache-tomcat-6.0.29libjsp-api.jar;.; When I go to bin folder and double click on startup.bat then my tomcat starts and when I double click on shutdown.bat tomcat stops. But I want using CMD start and stop the tomcat. And in any folder I write command startup.bat the

when is a spring bean instantiated

In the above, when are the beans instantiated, when the ApplicationContext is created or when the getBean() is called? Answer Assuming the bean is a singleton, and isn’t configured for lazy initialisation, then it’s created when the context is started up. getBean() just fishes it out. Lazy-init beans will only be initialised when first referenced, but this is not the

How can I add JAR files to the web-inf/lib folder in Eclipse?

I’m using Eclipse and I need to be able to add Java libraries (JAR files) into my web application’s WEB-INF/lib folder. How do I achieve this? Answer Add the jar file to your WEB-INF/lib folder. Right-click your project in Eclipse, and go to “Build Path > Configure Build Path” Add the “Web App Libraries” library This will ensure all WEB-INF/lib

Advertisement