如果 bean 在会话范围内,为什么 h:commandLink 不能在数据表内工作

发布于 2025-01-03 02:55:50 字数 298 浏览 2 评论 0原文

我正在开发 jsf 1.2 应用程序。我将 bean 保留在请求范围内,并在数据表中使用 h:commandLink 将 rowId 传递给 bean 类。但如果我将 bean 保留在请求范围内,它就不起作用,我需要将其更改为会话范围。但是当我回到使用这个bean的选项卡时,存在会话范围的问题,它显示了以前的值(显然), 我不会。

任何人都可以告诉如何解决这个问题

1>当请求 bean 范围时如何在 dataTable 中使用 h:commandLink 或 2>如何从会话范围中删除 bean。

请帮助我提前致谢。

i am working on jsf 1.2 application. i have kept bean in request scope and used h:commandLink inside datatable which passes rowId to bean class. But it is not working if i keep bean in request scope, i needed to change it to session scope. but there is problem of session scope as i come back to tab that uses this bean it shows previous values (Obviously),
which i dont wont.

can any one tell how to solve this problem

1>either how to use h:commandLink inside dataTable when bean scope is request or
2> how to remove bean from session scope.

please help me out thanks in advanced.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲世九天 2025-01-10 02:55:51

我解决了如何从会话范围中删除 bean 的问题,
当我返回上一页时,我使用了以下代码:

HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);  
        session.removeAttribute("someBean");
        return "prevPage";

i got solution to my problem to how to remove bean from session scope,
I have use following code when i go back to previous page :

HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);  
        session.removeAttribute("someBean");
        return "prevPage";
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文