Problems encountered during Web server (protein protection) Setup

Source: Internet
Author: User

1, StringBuffer The Append method has the error

Cause analysis: Is the default JRE system library for project and the configured JRE mismatch.

Workaround: Project Properties->add libray->jre System library->alternate JRE (select Sun JDK 1.6.0_13)

2, File Upload problem

Mysmartupload.setallowedfileslist ("txt"); Set upload file type can only be txt format

File upload Process

  • jsp file:
     <div id= " input   " Align="  center   " Style="  width:900px;   " > <p>please  file  <input type= file   " Name="  uploadfile   " Id="  file   " > &nbsp;&NBSP;  </div> 

     

  • servlet file:
    PrintWriter out=Response.getwriter (); String Wrongmessage= "Success!"; Smartupload Mysmartupload=Newsmartupload ();        Mysmartupload.initialize (config, request, response); Mysmartupload.setmaxfilesize (1024*2048); //mysmartupload.setallowedfileslist ("txt"); //Bebug        intj = 0; Try{mysmartupload.upload ();  for(inti = 0; I < Mysmartupload.getfiles (). GetCount (); i++)             {                ++J; Com.jspsmart.upload.File File=mysmartupload.getfiles (). GetFile (i); if(File.ismissing ())Continue; }        }Catch(Exception err) {wrongmessage= "Error in upload" + err.getmessage () + "File:" +j+ "on line 251"; //out.println ("Error in Upload" +err.getmessage ()); //Allright=false; //return;} out.print (Wrongmessage+ "num:" +j); }

    3, prompt error, serialversionuid conflict.

class class Serialversionuid = 8915824483106432775

Serialversionuid Detailed Description: http://www.cnblogs.com/guanghuiqq/archive/2012/07/18/2597036.html

Workaround:

If you don't want to define it, you can also turn it off in Eclipse settings as follows:

Window ==> Preferences ==> Java ==> Compiler ==> error/warnings ==>potential Programming problems

Change the warning of the serializable class without serialversionuid to ignore.

2014-09-20

This content complies with CC3.0 Copyright Agreement, reprint Please specify: Turn self-study and excellent, think then pass

This article link address: Web server (protein protection) problems encountered during the construction process

Problems encountered during Web server (protein protection) Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.