2 fnzf14428547 fnzf14428547 于 2016.02.19 10:08 提问

刚开始学java,现在看一个项目看不懂到底用什么框架

看起来是spring,但是又觉得有点不同,请帮我看一下,下面是web.xml文件内容和springContext

 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>WEB-INF/SpringContext.xml</param-value>
  </context-param>
  <context-param>
    <param-name>purviewclass</param-name>
    <param-value>qtone.xxt.teacher.base.init.PurviewImp</param-value>
  </context-param>
  <context-param>
    <param-name>log4j</param-name>
    <param-value>WEB-INF/log4j.xml</param-value>
  </context-param>
  <context-param>
    <param-name>springUtilHandlerClass</param-name>
    <param-value>qtone.xxt.teacher.base.init.SpringContextImp</param-value>
  </context-param>
  <session-config>
    <session-timeout>120</session-timeout>
  </session-config>
  <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>
            org.springframework.web.filter.CharacterEncodingFilter
        </filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>utf-8</param-value>
    </init-param>
    <init-param>
      <param-name>forceEncoding</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>*.do</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>IllegalCharacterFilter</filter-name>
    <filter-class>qtone.xxt.teacher.base.filters.IllegalCharacterFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>IllegalCharacterFilter</filter-name>
    <url-pattern>*.do</url-pattern>
  </filter-mapping>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener>
  <listener>
    <listener-class>qtone.xxt.teacher.base.init.XxtContextListen</listener-class>
  </listener>
  <filter>
    <filter-name>urlfilter</filter-name>
    <filter-class>qtone.xxt.teacher.base.ActionFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>urlfilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>dispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>dispatcherServlet</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

  <!--dwr -->

   <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <servlet-class> org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
        <param-name>crossDomainSessionSecurity</param-name>
           <param-value>false</param-value>
        </init-param>
    <init-param>
      <param-name>allowScriptTagRemoting</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>classes</param-name>
      <param-value>java.lang.Object</param-value>
    </init-param>
    <init-param>
        <param-name>activeReverseAjaxEnabled</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
       <param-name>initApplicationScopeCreatorsAtStartup</param-name>
       <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>maxWaitAfterWrite</param-name>
        <param-value>3000</param-value>
    </init-param>
    <init-param>
        <param-name>debug</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>logLevel</param-name>
        <param-value>WARN</param-value>
    </init-param>
</servlet>
<!-- 
<servlet>
         <servlet-name>dwr-invoker</servlet-name>
         <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
         <init-param>
          <param-name>debug</param-name>
          <param-value>true</param-value>
         </init-param>
         -->
         <!-- 使用polling和comet的方式 -->
<!--
         <init-param>
          <param-name>pollAndCometEnabled</param-name>
          <param-value>true</param-value>
         </init-param>
         <load-on-startup>1</load-on-startup>      
</servlet>
 --> 
<servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
 <!--dwr  结束--> 
  <welcome-file-list>
    <welcome-file>/mhnew/htm/all.htm</welcome-file>
  </welcome-file-list>
</web-app>

5个回答

devmiao
devmiao   Ds   Rxr 2016.02.19 10:09

spring+polling和comet实现web双向通讯,比如聊天等

fnzf14428547
fnzf14428547 但是这个网站不是通讯的啊
接近 2 年之前 回复
StefanLee2015
StefanLee2015   2016.02.19 10:20

很明显的spring框架。可以从:
org.springframework.web.context.ContextLoaderListener

org.springframework.web.context.request.RequestContextListener
这些看的出来。

StefanLee2015
StefanLee2015 回复fnzf14428547: 具体指哪些不同?
接近 2 年之前 回复
fnzf14428547
fnzf14428547 但是我看网上很多教程,和这个也有些不同啊
接近 2 年之前 回复
diaoliwei2
diaoliwei2   Rxr 2016.02.19 11:16

确实是spring框架,你说的不同,不是指spring的配置不同吧,而是他还配置了其他的东西

qq_19558705
qq_19558705   Ds   Rxr 2016.02.19 11:53

java框架并不多,多的是第三方资源。主体是spring。至于不一样,可肯定是必须的。如果spring的配置都是一样,那岂不都去copy了?根据自己的业务场景需要添加其他内容进来,配置自然就不一样了。

qq_19558705
qq_19558705 回复fnzf14428547: 可能也整合了struts,也可能需要调用struts.jar中封装的方法。
接近 2 年之前 回复
fnzf14428547
fnzf14428547 我看到里面还有struts.jar这个包
接近 2 年之前 回复
fnzf14428547
fnzf14428547 嗯知道了,谢谢大哥
接近 2 年之前 回复
Royal_lr
Royal_lr   Ds   Rxr 2016.02.19 19:53

主体是spring,,spring还嵌套了很多插件,,

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!