项目;但是,这些我们统统都不需要,我们只要web\WEB-INF目录下的东西 ,在这个目录下,提供了一个web.xml,同时在lib目录下提供了两个.jar文件,这便是全部 。看到这里,大家肯定能够想到,Java Web项目的灵魂是什么?那就是web.xml。我们所要 做的,就是把lib目录下的两个.jar文件拷贝到我们项目的src/main/webapp/WEB-INF/lib下 ,同时将web.xml中的内容整合到我们项目的src/main/webapp/WEB-INF/web.xml中。
web.xml中的内容很简单,只定义了两个Servlet映射,并且对上传文件的目录和允许哪 些文件上传、拒绝哪些文件上传做了设置,如下:<servlet>
<servlet-name>Connector</servlet-name>
<servlet- class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet- class>
<init-param>
<param-name>baseDir</param-name>
<param-value>/UploadFiles/</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>SimpleUploader</servlet-name>
<servlet- class>com.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet- class>
<init-param>
<param-name>baseDir</param-name>
<param-value>/UploadFiles/</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>enabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsFile</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>DeniedExtensionsFile</param-name>
<param- value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi< ;/param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsImage</param-name>
<param-value>jpg|gif|jpeg|png|bmp</param-value>
</init-param>
<init-param>
<param-name>DeniedExtensionsImage</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsFlash</param-name>
<param-value>swf|fla</param-value>
</init-param>
<init-param>
<param-name>DeniedExtensionsFlash</param-name>
<param-value></param-value>
& |