2014年5月17日星期六

Great God will help us to see ! Really drunk ! ! !

entity class photo entity [


package com.hafizgoo.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Fbphoto entity. @author MyEclipse Persistence Tools
 */

public class Fbphoto implements java.io.Serializable {

// Fields

private Long fbpid; //照片id
private Fbalbum fbalbum; //相册实体
private Date fbctime;    //创建时间
private String fbpname;   // 照片名称
private String fbctype;    //照片类型
private byte[] fbpcontent; //照片
private byte[] fbpthum;    //照片小图
private Integer fbporder;  //相册内顺序
private Set fbcomments = new HashSet(0);
private Set fbmarks = new HashSet(0);
public Long getFbpid() {
return fbpid;
}
public void setFbpid(Long fbpid) {
this.fbpid = fbpid;
}
public Fbalbum getFbalbum() {
return fbalbum;
}
public void setFbalbum(Fbalbum fbalbum) {
this.fbalbum = fbalbum;
}
public Date getFbctime() {
return fbctime;
}
public void setFbctime(Date fbctime) {
this.fbctime = fbctime;
}
public String getFbpname() {
return fbpname;
}
public void setFbpname(String fbpname) {
this.fbpname = fbpname;
}
public String getFbctype() {
return fbctype;
}
public void setFbctype(String fbctype) {
this.fbctype = fbctype;
}
public byte[] getFbpcontent() {
return fbpcontent;
}
public void setFbpcontent(byte[] fbpcontent) {
this.fbpcontent = fbpcontent;
}
public byte[] getFbpthum() {
return fbpthum;
}
public void setFbpthum(byte[] fbpthum) {
this.fbpthum = fbpthum;
}
public Integer getFbporder() {
return fbporder;
}
public void setFbporder(Integer fbporder) {
this.fbporder = fbporder;
}
public Set getFbcomments() {
return fbcomments;
}
public void setFbcomments(Set fbcomments) {
this.fbcomments = fbcomments;
}
public Set getFbmarks() {
return fbmarks;
}
public void setFbmarks(Set fbmarks) {
this.fbmarks = fbmarks;
}
public Fbphoto(Fbalbum fbalbum, Date fbctime, String fbpname,
String fbctype, byte[] fbpcontent, byte[] fbpthum,
Integer fbporder, Set fbcomments, Set fbmarks) {
super();
this.fbalbum = fbalbum;
this.fbctime = fbctime;
this.fbpname = fbpname;
this.fbctype = fbctype;
this.fbpcontent = fbpcontent;
this.fbpthum = fbpthum;
this.fbporder = fbporder;
this.fbcomments = fbcomments;
this.fbmarks = fbmarks;
}
public Fbphoto() {
super();
// TODO Auto-generated constructor stub
}

// Constructors

/** default constructor */

}

package com.hafizgoo.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.hafizgoo.dao.FbalbumDao;
import com.hafizgoo.dao.FbphotoDao;
import com.hafizgoo.entity.Fbalbum;
import com.hafizgoo.entity.Fbuser;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("all")
public class AlbumAction extends ActionSupport {

// 注入相册Dao
FbalbumDao fbalbumDao;
   

public void setFbalbumDao(FbalbumDao fbalbumDao) {
this.fbalbumDao = fbalbumDao;
}
//注入相片Dao
FbphotoDao fbphotoDao;

public void setFbphotoDao(FbphotoDao fbphotoDao) {
this.fbphotoDao = fbphotoDao;
}
// 封装F
Fbalbum fbalbum;

public Fbalbum getFbalbum() {
return fbalbum;
}

public void setFbalbum(Fbalbum fbalbum) {
this.fbalbum = fbalbum;
}
    

Long id;
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

private Map Session() {
ActionContext ac=ActionContext.getContext();
Map session=ac.getSession();
return session;
}

/**
 * 根据相册id获得相册内的照片集合
 * @return
 */
public String list(){
Map session = Session();
List made=fbphotoDao.findByProperty("fbalbum.fbaid", id);
session.put("made", made);
List<String>fuck=new ArrayList<String>();
fuck.add("cao");
fuck.add("gan");
session.put("dou",fuck);
return "list";
}
}



jsp page

<s:iterator var="#session.made"> 
<li>
<s:if test="%{fbppid!=null}">
0000000000000000
      </s:if>
       <s:if test="%{fbppid==null}">
11111 <s:property value="#fbpid"/>
      </s:if>
<dl><dt><a href="photo_big?id=${fbpid}"><img src="photo_show?id=${fbpid}&bs=s" /></a></dt>
<dd><a href="#"></a> <s:property value="fbpid"/>+<s:property value="fbpname"/></dd>
</dl>
</li>
</s:iterator>


The current situation is get made ​​photo collection page with can output shows that there exists an entity class , but iteration , the output attribute nothing is displayed if the object alone kept a photograph , but also can be displayed on the page ! Find Great God pointing pointing drunk.
------ Solution -------------------------------------- ------
it feels like a single value if el expression output list will be displayed [ ..... ] such content .                      
with is displayed [ full path + memory address of the entity class ] number and the number of objects is normal to find consistent       
However, when the number of iterations and the number of objects is inconsistent , he is only a few objects regardless of iteration once.       
           bracketed description is an array , a loop the loop body is not likely to affect the terminal in the loop, you can try to simplify the loop , the first output

111

to see how many lines can be output .          
I tried this before the result is this   
showed three objects   
[com.hafizgoo.entity.Fbphoto @ 7271, com.hafizgoo.entity.Fbphoto @ 1598c01, com.hafizgoo.entity.Fbphoto @ 19bc34c]   
but only output iterator again   
11111   
project iteration what other classes are good that this class really drunk. The hour is late , and then point you rest. . .  
This is the problem of the use of the label to see properties with a value or a normal label and compare
------ Solution -------------- ------------------------------

1: data for the thing to put the session, you think this is okay , directly define a list collection , get set about removing the page directly ,
2: you sure iteration var?
------ For reference only ---------------------------------------
struts2 unfamiliar, but to find the problem the method is the same, you first look output is made ​​to an object or multiple objects can look out for.
------ For reference only -------------------------------------- -
have a physical display physical memory address but the output attribute nothing to ! ! !
------ For reference only -------------------------------------- -.
it feels like a single-valued expression if el output list will be displayed [ ..... ] such content .
------ For reference only -------------------------------------- -.
it feels like a single-valued expression if el output list will be displayed [ ..... ] such content .  
with is displayed [ full path + memory address of the entity class ] number and the number of objects is normal to find consistent
However, when the number of iterations and the number of objects is inconsistent , he is only a few objects regardless of iteration once.

------ For reference only ---------------------------------- -----
to pull down your entity class properties change, for example : fbpname - "fbpName This is a standardized naming
try agin ...
------ For reference only ---------------------------- -----------


Oh, I try. This is the reverse generated no change, but I feel this is not a problem , because the individual object attributes can be seen.
------ For reference only -------------------------------------- -.
it feels like a single-valued expression if el output list will be displayed [ ..... ] such content .          
with is displayed [ full path + memory address of the entity class ] number and the number of objects is normal to find consistent   
However, when the number of iterations and the number of objects is inconsistent , he is only a few objects regardless of iteration once.   
  bracketed description is an array , a loop the loop body is not likely to affect the terminal in the loop, you can try to simplify the loop , the first output

111

to see how many lines can be output .
------ For reference only -------------------------------------- -.
it feels like a single-valued expression if el output list will be displayed [ ..... ] such content .                
with is displayed [ full path + memory address of the entity class ] number and the number of objects is normal to find consistent     
However, when the number of iterations and the number of objects is inconsistent , he is only a few objects regardless of iteration once.     
       bracketed description is an array , a loop the loop body is not likely to affect the terminal in the loop, you can try to simplify the loop , the first output

111

to see how many lines can be output .  
I tried this before the result is this
showed three objects
[com.hafizgoo.entity.Fbphoto @ 7271, com.hafizgoo.entity.Fbphoto @ 1598c01, com.hafizgoo.entity.Fbphoto @ 19bc34c]
but only output iterator again
11111
project iteration what other classes are good that this class really drunk. The hour is late , and then point you rest. . .
------ For reference only -------------------------------------- -

hey really remiss , the following is wrong here never thought rub ! Thank you very much ! ! ! The first proposal is also very good adoption ! ! Thank you thank you ! !

没有评论:

发表评论