struts结构中jsp页面的是什么意思?

fishone 2003-01-27 02:13:49
struts结构中jsp页面的<logic:present name="">是什么意思?
...全文
381 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sandyen 2003-01-27
  • 打赏
  • 举报
回复
比如
<logic:present name="myBean" >
<table>
...
</table>
</logic:present>
如果你的session或是request里面有这个myBean
将执行你的标签里面的内容
如果没有的话,就不执行
sandyen 2003-01-27
  • 打赏
  • 举报
回复
如果你的session或是request里面有这个beanName
将执行你的标签里面的内容
如果没有的话,就不执行
carrysilence 2003-01-27
  • 打赏
  • 举报
回复
这个标记一般可以用来做你的get方法获得的值是否为null
也就是是否存在一个返回值.

比如我的私变量

String name =null;

getName() 返回它的值

那么就可以用这个标记来判断name是不是有值.
teddy_huang 2003-01-27
  • 打赏
  • 举报
回复
好像是说如果name所指定的的值存在的话,执行logic:present 标记之间的内容
package com.list.struts.util; import java.util.ArrayList; public class Page { //当前跳转的页面情况 private String pagetype; private PaginationBean pagination; private ArrayList result; //构造函数实例化接收一个pagetype和PaginationBean对象 public Page(String pagetype, PaginationBean pagination) { this.pagetype = pagetype; this.pagination = pagination; } /** * * */ public boolean isEmpty() { if (pagetype == null || pagetype.equals("")) { return true; } else { return false; } } /** * * * */ public ArrayList getResult() { if (!isEmpty()) { if (pagetype.equals("nextPage")) { result = pagination.getNextPage(); } else if (pagetype.equals("previousPage")) { result = pagination.getPreviouspage(); } else if (pagetype.equals("lastPage")){ result = pagination.getLastPage(); } else if (pagetype.equals("firstPage")){ result = pagination.getFirstPage(); } else{ result=pagination.getJumpPage(pagetype); } } else { result = pagination.getProducts(); } return result; } /** * * * */ //此对象保存了页面的所有情况,包括多少页等信息 public PaginationBean getPagePagination() { return pagination; } /** * * */ //实例化PaginationBean的构造函数 public void Init(ArrayList result) { this.result = result; pagination = new PaginationBean(result); } } ------------------------------ import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.list.struts.form.ListForm; import com.list.struts.util.Page; import com.list.struts.util.PageBean; import com.list.struts.util.PaginationBean; import com.list.struts.vo.newgetResouce; public class ListAction extends Action { /* * Generated Method

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧