struts-config.xml中
  <plug-in className="org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn">
    <set-property property="pathname" value="/WEB-INF/database.xml"/>
  </plug-in>

解决方案 »

  1.   

    可是
    <plug-in className="org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn">
        <set-property property="pathname" value="/WEB-INF/database.xml"/>
      </plug-in>指定的是pathname,这个不太了解...

    <logic:notPresent name="database" scope="application"></logic:notPresent>这句是查找当前应用范围内是否存在一个名为"database"的bean.我想这个database应该指向一个具体的bean.可是配置中没有指定呀!!!
    还有
    <logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application"></logic:notPresent>
    这个"MESSAGE"又与谁在那里关联的呢!!!!
    多谢!!!
      

  2.   

    \WEB-INF\classes\org\apache\struts\webapp\example\ApplicationResources.properties
      

  3.   

    pathname只是MemoryDatabasePlugIn的一个property
    你可以认真看一下MemoryDatabasePlugIn.java
        public void init(ActionServlet servlet, ModuleConfig config)
            throws ServletException {
    ...
            // Make the initialized database available
            servlet.getServletContext().setAttribute(Constants.DATABASE_KEY,
                                                     database);
    ...
      

  4.   

    至于org.apache.struts.action.MESSAGE我也不是很清楚,有空我再看看
      

  5.   

    啊哈,你可以反编译ActionServlet.class看一下,很有趣
    在ActionServlet里用
    org.apache.struts.action.FORM_BEANS
    org.apache.struts.action.FORWARDS
    org.apache.struts.action.MAPPINGS
    org.apache.struts.action.MESSAGE
    等来关联struts-config.xml中的Element
    其中org.apache.struts.action.MESSAGE关联struts-config.xml中的<message-resources> Element
    而struts-config.xml中
      <!-- ========== Message Resources Definitions =========================== -->  <message-resources
        parameter="org.apache.struts.webapp.example.ApplicationResources"/>  <message-resources
        parameter="org.apache.struts.webapp.example.AlternateApplicationResources"
        key="alternate">
      </message-resources>
    和 wlz_bj() 说得还差不多
      

  6.   

    这样看来database和org.apache.struts.action.MESSAGE在应用程序启动时候就已经装载了,通过servlet.getServletContext().getAttribute()就可以获得,我也大有收获啊
      

  7.   

    非常感谢rubyz(左思右想),谢谢!!!,另外,我想问一下,你用的是什么反编工具呀!这么厉害,我没有用过,能不能介绍一下呀!谢谢!!!
      

  8.   

    很有收获。顺便问一下:
    <html:html locale="true">//上边这句什么意思??<head>
    <title><bean:message key="index.title"/></title>
    <html:base/>
    </head>
    <body bgcolor="white"><logic:notPresent name="database" scope="application">还有
    <html:html 
    <bean:message 
    <logic:notPresent 
    这几个标签是什么意思啊?  有人可以告诉我吗?
    可以开贴给分的。
      

  9.   

    反编译工具
    DJ Java Decompiler 2.9
    chili1979(中国龙)
    建议去用一下struts提供的例子
    struts-exercise-taglib.war
    里面是关于标签的例子