Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Parse not working in a doPost  RSS feed

 
Kerry Shannon
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the following message when trying to use the parse method of the SimpleDateFormat class. It doesn't seem to like the ParseException in the servlet. Here's the error.
Exception java.text.ParseException in throws clause of
void com.eds.timeentry.subscribe.SaveTimeServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
is not compatible with
void javax.servlet.http.HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have the API in front of me, but it seems you'll have to catch the text parsing exception, and simply rethrow a servletexception.

I'm a bit fuzzy on exception throwing, but I don't think you can throw an exception that is not of the same class, or a sub class of a method you are overriding in a superclass. So if the doPost method throws a servletException, then all your overriden doPost can throw is servletExceptions, or subclasses of servletExceptions.

It would look something like this:
someone please correct that if it's wrong!
[This message has been edited by Mike Curwen (edited May 24, 2001).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!