Revision: 951
http://stripes.svn.sourceforge.net/stripes/?rev=951&view=rev
Author: bengunter
Date: 2008-08-15 13:44:46 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
Fixed STS-599. FormTag checks the session scope for its ActionBean if it
doesn't fine one in the request scope.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/tag/FormTag.java
Modified: trunk/stripes/src/net/sourceforge/stripes/tag/FormTag.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/FormTag.java 2008-07-29
18:30:37 UTC (rev 950)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/FormTag.java 2008-08-15
13:44:46 UTC (rev 951)
@@ -29,6 +29,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTag;
@@ -342,8 +343,15 @@
* @return ActionBean the ActionBean bound to the form if there is one
*/
protected ActionBean getActionBean() {
- return (ActionBean)
getPageContext().getRequest().getAttribute(this.actionWithoutContext);
- }
+ HttpServletRequest request = (HttpServletRequest)
getPageContext().getRequest();
+ ActionBean bean = (ActionBean)
request.getAttribute(this.actionWithoutContext);
+ if (bean == null) {
+ HttpSession session = request.getSession(false);
+ if (session != null)
+ bean = (ActionBean)
session.getAttribute(this.actionWithoutContext);
+ }
+ return bean;
+ }
/**
* Returns true if the ActionBean this form posts to represents a Wizard
action bean and
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development