background image

             <s:param name=" " value=""></s:param> 
          </s:url>
       ">超链接</a>
    8. set 标签,用于将某个值放入指定的范围内。例如 application,session

 

等。

       <s:set name="user" value="userName" scope=”request”/>

6.

struts 中怎么配置 form-beanactiontiles

    此处配置的是 struts1.2 的
    form-bean 配置:(在配置文件 struts-config.xml 中):
    <form-beans >
  

<form-bean name="" type=""></form-bean>

   </form-beans>
    name: 指定 form 的名字; type 指定 form 的类型:包名+类名;
   action 配置:(在配置文件 struts-config.xml 中)
   <action-mappings >
  

<action path="" 

  

        attribute=""

  

        input=""

  

        name=""

  

        parameter=""

  

        scope="request"

  

        type=""

  

        ></action>

   </action-mappings>
   path:请求 Action 的名字;   attribute:form 的名字,与 form-bean 中的 name 对应;   input:输
入页的路径; 
   name:如果配置了 attribute,name 不起作用,与 attribute 一样;   parameter:使用分发 Action
时,指定调用分发 Action 中的方法名;
   scope:Action 的范围;    type:Action 的类型:包名+类名;
   
   tites 配置:
   1. 

 

新建一个 tiles-defs.xml 文件,并在其中做如下配置:

      <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE   tiles-definitions   PUBLIC   "-//Apache   Software   Foundation//DTD   Tiles 
Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
      <tiles-definitions> 
        <definition name="member-definition" path="/Jsp/layout.jsp">  
          <put name="top" value="/mTop.do"/>  
          <put name="left" value="/mLeft.do"/>
          <put name="main" value="/defaultMmain.do"/> 
        </definition>
     </tiles-definitions>
   2. 在 web.xml 和 struts-config.xml 和 web.xml 中做相应配置:
      在 struts-config.xml 中配置如下:
      ************
      <plug-in className="org.apache.struts.tiles.TilesPlugin">