Part in my jsp page where I am passing date after submit of this form to the servlet:             &lt;div class="form-group"&gt;               &lt;tr&gt;                   &lt;td&gt;Date&lt;/td&gt;                   &lt;td&gt;&lt;input type=date step=7 name="day" required="required"&gt; &lt;/td&gt;               &lt;/tr&gt;              &lt;/div&gt;   In my servlet I wrote:  Date day=new Date();  String startDateStr = request.getParameter("day");     System.out.println("stsartdate Str"+startDateStr);     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");     try {         date=sdf.parse(request.getParameter("startDateStr"));         System.out.println("date entered is="+date);     } catch (ParseException e) {         e.printStackTrace();     }   It is prompting me a null pointer exception.  Mar 31, 2016 3:21:20 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [com.controller.TravelServlet] in     context with path [/LetsRide] threw exception java.lang.NullPointerException at java.text.SimpleDateFormat.parse(Unknown Source) at java.text.DateFormat.parse(Unknown Source) at com.controller.TravelServlet.doPost(TravelServlet.java:76) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at     org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)   However, the print statement where I am printing the date fetched from the jsp page in the form of string, it is printing:   stsartdate Str2016-03-10   It is throwing null-pointer exception while executing try block. Kindly get me out of this. Thanks in advance.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Just noticed a minor css issue on this question:    The related questions on the right hand side have some overlapping text in Chrome:        (This only applies to this very site, Meta Stack Exchange) How to give name to topics created using LDA? The Follow Questions and Answers feature is now live across the Network We are happy to announce that the  follow question and answer feature is now live across the Network, including Stack Overflow, all Stack Exchange sites, and all Meta sites. (International Stack Overflow sites will have it turned on in a day or two once we have translations all set.) You can follow any question or answer (that you did not author) by clicking on the [follow] button that is shown in the menu immediately below the post (alongside the [share] button):    After you have followed a post, you will get inbox notifications for all new answers (in the case where you followed a question), comments, edits, and notices. You will not receive notifications for any action that you performed. As was mentioned in the earlier post, we are not making changes at this point to the notifications received by a post owner, or due to @mentions. The initial release had been planned to only include question following. Thanks to many folks who chipped in over the past few weeks, we are happy to release both question and answer following at the same time. These are available in both the regular and mobile views. We are still planning on two more related releases:  Follows profile tab and question listing filter: A tab for follows will be added to your user profile activity page. Each user will be able to view this tab that will provide a listing of followed questions and answers, with standard sorts, and the ability to unfollow from the listing. Users (with the exception of moderators and authorized staff) will not be able to see this information about other users (nor will it be made public in the API, SEDE, or data dumps). We will be renaming the Favorites feature to Bookmarks. As we mentioned in the preview post, the feature will be the same as Favorites, with the name and icon updated to more accurately represent user expectations and usage. And you will be able to both &quot;bookmark&quot; and &quot;follow&quot; a question.  We hope that this new feature will allow you to have better access to the content that you care about and want to keep tabs on. Update (June 11, 2020): The user profile tab and the rename of Favorites to Bookmarks have been released. Ubuntu 14.04 has visual artifacts and freezes I keep reading about  ('PPAs') and people answer questions with a link to a PPA. What's the best way to use these?     There are multiple valid answers for this question spanning over several versions of Ubuntu. For your convenience, an index of each is below. "method driver /usr/lib/apt/methods/https could not be found" update error sudo apt-get update E: The method driver /usr/lib/apt/methods/https could not be found. michael@Ubuntu:~$ sudo apt-get clean michael@Ubuntu:~$ cd /var/lib/apt michael@Ubuntu:/var/lib/apt$ sudo mv lists lists.old michael@Ubuntu:/var/lib/apt$ sudo mkdir -p lists/partial michael@Ubuntu:/var/lib/apt$ sudo apt-get clean michael@Ubuntu:/var/lib/apt$ sudo apt-get update E: The method driver /usr/lib/apt/methods/https could not be found. E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? michael@Ubuntu:/var/lib/apt$ sudo apt-get update E: The method driver /usr/lib/apt/methods/https could not be found.   Why am I getting these errors when doing an apt-get update? Is it possible to repeat my track object along a path? I tried using the method shown here  using an array and then a curve modifier, but this happened when I added the curve modifier and chose the path as the curve object. Where can I find a free, very quick, and reliable implementation of FFT in C#?  That can be used in a product? Or are there any restrictions? Should we put the references in slides/poster when we already have them in paper? After reading this question about  and asking myself two questions about  and , I realize that these activities are for showing what you found, make the audience be attracted. If they need further explanation, they should read your paper, which has successfully defensed and proved that your work is validated. One important thing when you attempt to attract people is concentrate on the important, which means unnecessary things need to be trimmed. I think the reference is one of those. So, should we put the references in slides/poster when we already have them in paper? Kinetic energy is simple, right?! from the equation it seems as though if you know the speed and mass you'll know the work. Let's try to prove it. let's assume we know the acceleration and distance for now. $$w=mda$$ So the distance is $$d= 1/2 *at^2$$ Then  $$t = \sqrt{2d/a}$$ So $a*t$, which is the speed, is  $$a*\sqrt{2d/a} = a* \sqrt{2d}/\sqrt{a} = \sqrt{2da} = \sqrt{2w/m}$$ So regardless of the distance or acceleration, if you know the work and the mass, you can calculate the speed which is  $$v=\sqrt{2w/m}$$  What if you know the speed and the mass? You can easily calculate the work. $$v = \sqrt{2w/m}$$ Then  $$v^2 = 2w/m$$  That would mean  $$m*1/2*v^2=W $$ Rearrange it and  $$W= 1/2 *m *v^2$$ would be the equation.  What if you have an initial speed and a new speed and want calculate the amount of work done after an initial speed to get the new speed? You'll just subtract the total work from the initial speeds work.  $$1/2mv^2 - 1/2ms^2$$  where s is  the initial speed and v is the new speed. However if you do it the other way which is  $$d= 1/2at^2 + vt$$ and solve it the answer would be $$1/2ms^2  + 1/2msv$$ Why aren't they equal? Any positive linear functional $\phi$ on $\ell^\infty$ is a bounded linear operator and has $\|\phi \| = \phi((1,1,...)) $ MVC DateTime binding with incorrect date format Any software for windows Writing custom (intelligent) microsoft windows firewall extension (C#/C++/C) Writing custom (intelligent) firewall for windows Installing nginx etc. on the same computer and use it as proxy with rules.   "You could not solve all Ddos problems with software" is not answer for this question.I want to reduce Ddos vulnarebility of my server.(It will stop low-level Ddos attacks)  Hosted solutions or cloud services are not related with this question.  Closing some of the ports and protocols via Microsot Windows Firewall is not related with this question.  Any idea?  EDIT After Questions  Low level: sample scenerio: 500 zombie clients and each of them sending 100 Custom Get/Post requests per second)   Web Application is on IIS. I want to stop attacks before they reach to IIS.  EDIT After Helpful Comment  How can the DDOS attack achieve its aim?   Exhausting bandwidth ( Not related with my question) Exhausting network hardware of server (NIC) ( Not related with my question) Exhausting server resources (RAM,CPU)  (Yep, I mean this)   If you stop attacks late, then you lost more resources! (Is this false?)   You can stop attacks on Web Application Level (in Asp.net MVc Code or in Handler) You can stop attacks on IIS (Dynamic Ip Restrictions)  You can stop attacks on lower levels (Firewall ..)   EXTRA INFO ABOUT THE LAST ATTACK (7 Hours ago)  When I connected server during the attack IIS Cpu Utilization was %92-%99. And when I try to connect homepage I got this error:  A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.) Show that the series $\sum\limits_{n=2}^{\infty} \frac {(n^3+1)^{1/3}-n}{\log n}$ converges How run a .jar file with a double-click? Prove that for every odd integer n, there is a group... Prove that for every odd integer n, there is a group with exactly n elements of order 2.  I am new to abstract algebra and proofs in general. Proving existence is difficult for me, but I will show what I have.  $$n = 2k + 1$$ $$k \in \mathbb{Z^+}$$  $$\exists G \supset H = (a_1 , a_2 , ..., a_n, e)$$  $$s.t. |a_1| = |a_2| = ... = |a_n| = 2$$  My instinct is to use Lagrange's Theorem, although I would like to try another method to prove this as we have not gone over cosets in class yet. If someone could just give me a hint of how to start, it would be very beneficial. Thank you. I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents: Sort array of objects by string property value Why does connecting a high-current device to my digital circuit cause weird behavior? How many people can the TARDIS transport? The interior of a TARDIS is much larger than its exterior, but how many occupants can it transport?