[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-720) Restful parameters are not always set in stateless beans

Gavin King (JIRA) jira-events at jboss.com
Tue Jan 30 19:25:19 EST 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-720?page=all ]

Gavin King closed JBSEAM-720.
-----------------------------

    Resolution: Rejected

You are using a stateless session bean to hold state.

Don't.

> Restful parameters are not always set in stateless beans
> --------------------------------------------------------
>
>                 Key: JBSEAM-720
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-720
>             Project: JBoss Seam
>          Issue Type: Bug
>    Affects Versions: 1.1.1.GA
>         Environment: JBoss 4.0.5GA, Seam 1.1.1GA, Facelets
>            Reporter: John Ray
>
> I've created a search page that has both a form to enter your search query and displays the results.  I've defined the following in my pages.xml
>     <page view-id="/search.xhtml">
>         <param name="search" value="#{groupSearch.searchString}"/>
>     </page>
> The groupSearch is an EJB3 stateless session bean with getSearchString()/setSearchString() methods in it.
> I wanted it to work so that when you browse to 
>     "/search.seam" - It just displays the form to enter a search keyword
>     "/search.seam?search=abc" - Displays the form to do a new search as well as the search results for "abc"
> If I browse to "/search.seam?search=abc" then Seam calls my setSearchString() method passing "abc" and everything works fine.
> The problem is when I then browse to the "/search.seam" which does not specify a search parameter.  Seam never calls my setSearchString() method. The groupSearch bean is cached and already had the searchString set to "abc" from the previous page so it ends up rendering the page as though a search was performed for "abc". It also seems to be a bit of a security bug because the stateless beans are shared among all users so one user can view what a different user has searched for. 
> If I create a 
>     @RequestParameter(value="search")
>     public void setSearchString(String searchString) {
>         ...
>     }
> then this method is always called and everything works fine. I just think that if I define the parameter in pages.xml then seam should treat it the same as @RequestParameter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list