Question about request

Dear Programmers

is it possible to hold value on request scope permanently?

For exmple, I have a bean called Person on the request scope.

After submiting the jsp which is connected to that bean I lose it (the bean). Next time that I'll use this JSP this bean will be created again. How can I solve it?

The tag <t:saveState> of MyFaces doesn't help me in this case.

[403 byte] By [dudushra] at [2007-10-2 10:27:24]
# 1
Try putting the bean in the session scope.CowKing
IamCowKinga at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for the help but this solution can't help me. I want that this object will be in request scope, otherwise if 2 browser windows will have the same session they'll ruin each other.
dudushra at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I don't think that 2 browsers can use the same session because they use different session-id's. (Perhaps if you have two different windows in the same browers they could use the same session).

You can always serialize your information and send to the browser in a hidden field, when the user submit a new request you can than deserialize the hidden field.

demaeya at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks for the helpYou were right, I use two different windows in the same browers (I didn't define the question correctly). I guess that I'll have to do what you suggested, although I hoped that there is an easier solution.
dudushra at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

I am in the same situation. I want to be able to have to windows open in the same session editting different things. The only way I could see how to do this was to have every page have a hidden field with a unique ID. Then you could grab this ID at the beginning of the submission, possibly in a custom view handler and set something so all subsequent calls during the processing of your request could operate on the correct objects.

I haven't been able to get it to quite work...in the view handler when I try and pick the field off the request object manually, I can't seem to find it...although the field was on the page as a hidden field in the form that was submitted. Not sure why, so I left it to revisit later. Let me know if you figure something out.

hergioa at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Hi

In order to solve the problem I acted like you suggested. it worked fine form just after I have defined tag that creates input like this:

<input id="_id56" type="hidden" action="submit" name="key" value="val" />

It seams that the tag <h:inputHidden> doesn't have the attribute action="submit" and that is why you didn't find it in the rrequest.

dudushra at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Actually, I ended up using the processScope functionality of Oracle's ADF faces which were just donated to Apache. Essentially I could put anything in this "process scope" and it would be maintained on a per-window basis across requests. It was a breeze to implement to.
hergioa at 2007-7-13 2:08:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...