Mvnforum is a good open source BBS Based on JSP. The whole process of building is as follows (the database uses
Oracle, which also supports MySQL and other databases; the appserver uses Tomcat ):
Create mvnforum 1.0.0-rc3_01
1. Create a database: Execute/SQL/mvnforum_oracle9. SQL
2. fixed the problem of uploading files in Chinese (use commons-fileupload-1.0 to replace the original file upload module)
(1) download the commons-fileupload-1.0 source code: http:
// Jakarta.apache.org/commons/fileupload/
Overwrite the package java.org. Apache. commons. fileupload
Net. myvietnam. mvncore. fileupload and change the package name
(2) modify the content of fileupload.
1. Modify com. mvnforum. User. attachmentwebhandler
Add the 146 rows in the Void processadd (httpservletrequest request) Method
Fileupload = new fileupload ();
Change
// Fileupload = new fileupload ();
Diskfileupload fileupload = new diskfileupload ();
If (request. getcharacterencoding () = NULL)
{
Fileupload. setheaderencoding ("UTF-8 ");
}
Else
{
Fileupload. setheaderencoding (request. getcharacterencoding ());
}
Add the 280 rows in the Void preparedelete (httpservletrequest request) Method
Attachfileitem. Write (filename );
Change
Attachfileitem. Write (new file (filename ));
2. Modify com. mvnforum. Admin
Set the public static void importxmlzip (httpservletrequest request,
In the httpservletresponse response) Method
Fileupload = new fileupload ();
Change
// Fileupload = new fileupload ();
Diskfileupload fileupload = new diskfileupload ();
Add 250 rows in the same method
Clientimportfileitem. Write (filepath );
Importfile = new file (filepath );
Change
Importfile = new file (filepath );
Clientimportfileitem. Write (importfile );
3. Modify com. mvnforum. User. memberwebhandler
Set the void uploadavatar (javax. servlet. servletconfig config,
Httpservletrequest request) Method
Fileupload = new fileupload ();
Change
// Fileupload = new fileupload ();
Diskfileupload fileupload = new diskfileupload ();
3. Set log4j attributes:
Set/mvnforum/WEB-INF/classes/log4j. Properties
Modify
Log4j. rootlogger = debug, A1, A3
And add
Log4j. appender. A3 = org. Apache. log4j. dailyrollingfileappender
Log4j. appender. a3.file = % tomcat_home %/webapps/mvnforum/WEB-INF/mvnforumhome/log/mvnforumlog.txt
Log4j. appender. a3.append = true
Log4j. appender. a3.datepattern = '. 'yyyy-mm-dd
Log4j. appender. a3.layout = org. Apache. log4j. patternlayout
Log4j. appender. a3.layout. conversionpattern = %-5R %-5 p [% T] % c {2}-% m % N
4. Set the default forum settings:
/Mvnforum/WEB-INF/classes/mvnforum. xml
Modify
<Mvnforum_home> % tomcat_home %/webapps/mvnforum/WEB-INF/mvnforumhome </mvnforum_home>
<Webmaster_email> youremail@yourdomain.com </webmaster_email>
<Logo_url> http://www.mvnForum.com </logo_url>
<Supported_locales> en; zh_cn; zh_tw </supported_locales>
<Default_locale_name> zh_cn </default_locale_name>
<Max_attachment_size> 1 MB </max_attachment_size>
5. Set database connection and email server:
/Mvnforum/WEB-INF/classes/mvncore. xml
Modify
<Driver_class_name> oracle. JDBC. Driver. oracledriver </driver_class_name>
<Database_url> JDBC: oracle: thin: @ 10.10.100.25: 1521: ctpdemo </database_url>
<Database_user> mvmouse </database_user>
<Database_password> ***** </database_password>
<Max_connection> 20 </max_connection>
<Max_time_to_wait> 2000 </max_time_to_wait>
<Minutes_between_refresh> 30 </minutes_between_refresh>
<Mailoptions>
<Mail_server> smtp.echannels.com.cn </mail_server>
<Default_mail_from> zhanghao@echannels.com.cn </default_mail_from>
<Username> zhanghao </username>
<Password> ***** </password>
<Port> 25 </port>
</Mailoptions>
<Paramoptions>
<Context_path>/mvnforum </context_path>
<Server_path> http: // 192.168.1.2: 8080 </server_path>
</Paramoptions>
6. Culture
Copy files under/mvnforum/mvnplugin/mvnforum/user/zh_cn to/mvnforummvnplugin/mvnforum/user
7. Copy mvnforum/template from the source file to % tomcat_home %/webapps/mvnforum/template
8. administrator login:
Mvnforumadmin/Index
User: Admin
Pass: Admin