You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by dm...@gmx.net on 2004/01/21 14:24:21 UTC

accessing formBeans from forwarded JSP page

Hello,

maybe I haven't understood the struts concept but I've run into a strange
problem and could use some advice.
I have a JSP page that sumbits a username and a password to an ActionForm.
After the Action does the business logic it forwards me to another JSP. From
that JSP I try to access values stored in the ActionForm bean.

This one works:
<bean:write name="loginActionForm" property="username" />

and this one doesn't (only retrieves a "null"):
<jsp:useBean id="loginActionFormId" scope="page"
class="cswebview.LoginActionForm"/>
...
<%=loginActionFormId.getUsername()%>  

Since both actions should be the same I cannot figure out what I'm doing
wrong. Anyway the package and the method call  are correct! 

Any help is very much appreciated!

Thanks in advance
Nic

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: accessing formBeans from forwarded JSP page

Posted by Dieter Mummenschanz <dm...@gmx.net>.
Hello!

YES! Thats it! Thanks soooo much :)

Nic




> Try (assuming a request-scoped form):
> 
> <jsp:useBean id="loginActionForm"
>              scope="request"
>              type="cswebview.LoginActionForm"/>
> <%= loginActionForm.getUsername() %>
> 



-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: accessing formBeans from forwarded JSP page

Posted by Kris Schneider <kr...@dotech.com>.
Try (assuming a request-scoped form):

<jsp:useBean id="loginActionForm"
             scope="request"
             type="cswebview.LoginActionForm"/>
<%= loginActionForm.getUsername() %>

Quoting dmummenschanz@gmx.net:

> Hello,
> 
> maybe I haven't understood the struts concept but I've run into a strange
> problem and could use some advice.
> I have a JSP page that sumbits a username and a password to an ActionForm.
> After the Action does the business logic it forwards me to another JSP.
> From
> that JSP I try to access values stored in the ActionForm bean.
> 
> This one works:
> <bean:write name="loginActionForm" property="username" />
> 
> and this one doesn't (only retrieves a "null"):
> <jsp:useBean id="loginActionFormId" scope="page"
> class="cswebview.LoginActionForm"/>
> ...
> <%=loginActionFormId.getUsername()%>  
> 
> Since both actions should be the same I cannot figure out what I'm doing
> wrong. Anyway the package and the method call  are correct! 
> 
> Any help is very much appreciated!
> 
> Thanks in advance
> Nic
> 
> -- 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org