English 中文(简体)
浏览器多重标签 - JSF 1.2 ad
原标题:Browser Multiples Tabs - JSF 1.2 ad
  • 时间:2012-05-24 21:39:32
  •  标签:
  • jsf

我正在研究一个 JSF 1.2 + Richfaces 系统。 这个系统是一种博客。 用户可以创建和管理他们的博客。 博客可以通过以下型号的 URL 访问 :

www.meublog.com/NameOfBlog

I used a single Managed Bean with session scope to make all controls. When the user accesses the blog, I use a filter that through the URL, which identified the blog being accessed, put the ID of the blog in the session and gave foward to the blog index. I used this session ManagedBean to control everything in the view of the blog. The problem is that the browser shares the same session between multiple tabs. When a user accesses the blog like this www.meublog.com/julio on one tab and www.meublog.com/fulano in another tab, I can not identify the two blogs because I have only one session established.

我想知道是否有人知道走这条正确的道路...

问题回答

您不应因为所要面对的原因而将范围信息存储在会议范围中。 使用范围管理豆类的请求, 而不是根据请求 URI 初始化。 您可以通过< a href="http://docs. oracle.com/javaee/5/ api/javax/faces/context/ ExternalContext.html" rel= “ nofollown noreferrr" code>ExternalCortext 和/ 或 < a href="http://docs. oracle.com/javaee/5/api/javax/servlet/http/ Htpservletes.html" rel=“ nofolpn noreferr"\code> Htpservertlett 。

例如,在豆类构造或

ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();

// If you use suffix mapping like *.jsf
String servletPath = ec.getRequestServletPath(); 

// Or if you use prefix mapping like /faces/*
String pathInfo = ec.getRequestPathInfo();

// Now initialize based on the value of either servletPath or pathInfo.

See also:





相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签