I'm using JSF,... I thought this is a stupid question but really i don't understand. My question: I have a jsf page: /product.xhtml
<f:metadata>
<f:viewParam name="p" value="#{singleProduct.p}" />
</f:metadata>
...
<h:form>
<h:inputTextarea value="#{singleProduct.content}" />
<h:commandLink value="Comment" action="#{singleProduct.postComment}" />
</h:form>
And my bean: SingleProduct
@Named
@SessionScoped
@Inject
private ProductService productService; //EJB
private int p;
private String content;
//Getters and setters;
public void postComment(){
productService.addComment(p,content); //addComment(int productId, String commentContent)
}
Now, i open a tab of browser with URL: /product.xhtml?p=1
. Then open another tab with URL:/product.xhtml?p=2
. Then return to tab with URL: /product.xhtml?p=1
to type and submit form.
I want to ask: The comment that is saved to database with how many productId values: 1 or 2 ?
I thought my question is related to state of JSF, but i don't understand about it clearly. Thanks