2 Replies Latest reply on Oct 9, 2009 6:13 PM by mschmidke

    Getting started with RESTful stateless application

    mschmidke
      Hello all,

      I want to write simple stateless application. I started with seam's documentation chapter 1.9.2 ff. I learned a lot from this and could use it in my own application, but there are still some questions I was not able to find the right keywords for to have Google help me out.

      Perhaps you have have some hints, links or so.

      Questions follow:

      1. How can I get rid of the "conversationId" URL parameter? I have learned about temporary conversations even if I do not explicitly start one, but in fact I do not want to see them in the URLs since my URLs shall be bookmarkable.

      2. How can I make a "stateless" form post? I want to be able to have the form on the user's screen as long as he wants, and posting it should be possible even if user session has timed out. I worked around this using a plain HTML form tag, but with that, I have to specify the whole path ("/ContextRoot/PathTo/Page.seam")(*)

      2a. How can I prevent saving state? Even with not having started a conversation, my event scoped page bean restores some state when the page is posted.

      3. Which tag should I use to link to pages? h:commandLink doesn't work after session timeout, s:link makes strange URLs which point back to the page I am on, and I was not able to figure out how to keep URL parameters on redirect. And with a href I again will have to specify the whole path.

      Is there some example for a really stateless application out there? I don't want to have any session timeout no matter how long the user needs to fill out a form, and I want to have clean bookmarkable URLs without any "garbage".

      Is this possible?

      Thank you all!!

      Marcus.



      (*) not always, but if I'm using URL rewrite, I never know: am I at /ContextRoot/Rewritten/xxx or at /ContextRoot/PathTo/Page.seam?id=xxx? So that using an absolute path is better
        • 1. Re: Getting started with RESTful stateless application
          cosmo

          2a. What do you mean by event scoped page bean restores some state when the page is posted.
          May be this is a browser cache issue. Did you try with autocomplete=off in h:inputText?


          3. h:outputLink renders a simple <a href> tag, but you have to specify the whole path.

          • 2. Re: Getting started with RESTful stateless application
            mschmidke
            2a. In my page bean, I have a reference to an entity. On the first request, it's loaded by ID using a request parameter. But on the second request - when the form is submitted -, the entity reference is somehow simply "there". So the bean must have somehow been in the session, but it is explicitly event scoped and I don't want it in the session. (In fact, I don't have a problem with the bean in the session [except that it's something I don't understand], but I don't want to run into problems when the user session times out between the first (GET) and second (POST) request.)