当使用 displaytag 时,它为分页和排序生成的 URL 对于 IE 来说太长了。
有没有办法在不借助外部分页和排序的情况下解决这个问题?
干杯。
最佳答案
希望这会对某人有所帮助。如果还有其他方法,请告诉我。
我解决这个问题的方法是排除显示表标签上的所有参数。
<display:table excludedParams="*"> ... </display:table>
这意味着 url 没有填充参数。
很好,但是您如何控制我们正在使用的对象列表?
我通过在上下文的请求上设置一个属性来做到这一点。当我使用 Stripes 框架时,我通过使用 ActionBeanContext 来做到这一点。
public class SchemeActionBeanContext extends ActionBeanContext {
public void setThings(List<Things> things) {
getRequest().getSession().setAttribute("stuff", things);
}
public List<Things> getThings() {
return (List<Things>)getRequest().getSession().getAttribute("stuff");
}
然后您可以在页面/请求的整个生命周期中设置和获取它们。
关于java - 生成的 DisplayTag 排序和分页链接(url)太长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3094603/