Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

doPost throws Exception "Size not matching"

Thread view: 
Madni - 24 Apr 2006 11:07 GMT
Dear all,

while i am trying to submit form to servlet , though things are doing
pretty good ,but mysteriosuly ,as soon as the servlet gets the post
request it throws an exception ,which when is printed (Exception
e.getMessage()) states "Size not matching" . Following are the related
code lines :

public void doPost(HttpServletRequest req, HttpServletResponse res)
throws
     ServletException, IOException {

   res.setContentType("text/html");
   PrintWriter out = res.getWriter();

   try {
    System.out.println("start dopost");
    //
   //          remaining code
   //
   } //try ends here

  catch(Exception e)
  {
       System.out.println("Exception message is " +  e.getMessage() );
  }

Hence the System.out.println() statements come in the order  like :

1: Exception message is Size not matching       //printed in catch
block
2: start dopost                                                 //
first line in the try block

Any help on this issue will be highly appreciated ....

Regards,
Madni
PMA - 24 Apr 2006 15:01 GMT
Madni a écrit :

> Dear all,
>
[quoted text clipped - 34 lines]
> Regards,
> Madni

First thing, just leave the execption bubbling up to the servlet engine
while you are in test phase, this will give you three major things :
a) The location of the error
b) The kind of exception
c) At compilation time, any unhandled exception kind that you should
wrap into a ServletException then throw. THe sample code can be :

doPost(.......) {
   try {
      // Business code
   } catch (Exception e) {
      if (e instanceof ServletException || e instanceof IOException)
          throw e;
      throw new ServletException(e);
   }
}

Best regards

Philippe


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.