`
hubin4
  • 浏览: 93331 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

strut-fast-1,something is offen use

阅读更多
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

1,用link可以

<html:link action="/xxxx">demo</html:link>

光有link还不行,得有N多参数给送过去,
一) 在request里一大群参数过去了,
     actionForm 会封装一部分[看你取名字了]
二)极少数情况,一些参数也要过去,
      过去参数肯定要用的,大都会被 actionform 吃掉
      实在要hardcoding参数,就<a href="/xxx/yyy.do?name=value&...
      还有一些情况,参数已经在scope里了,
      可以用<html:link action="/xxxx">demo</html:link>
       <html:link action="/xxxx" paramId="差不多就是name吧" paramName="scope里面的东东,就是EL{里面的东东}">click me</html:link>
       当然在scope里,不一定都是类似string的值,
       那就要这样把类似string的东西拿出来
       <html:link action="/xxxx" paramId="差不多就是name吧" paramName="scope里面的东东,就是EL{里面'.'号前面的东东}" paramProperty="EL{里面'.'号后面的东东">click me</html:link>
       上面都是一个 name-value对,如果有N多怎么办??
        用map,SUN规定的,没有为什么!!![当然,map就没有顺序了]
        <html:link action="/xxaction" name="map"></html:link>[当然map要先放scope里]
        同样,一个对象在scope里,他的一个 属性 是map 那就这样写:
        <html:link action="/xxaction" name="scope里的名字,这个名字-->找到对象" property="这个是属性为map类型的 属性的名字">ddd</html:link>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics