Daniel,

>From what you'd written, it looks like you're thinking of JSP 2.0 where the
JSP could use $loginForm.username to retrieve the value of the username
field from the session object loginForm.  So, I believe you want something
more like so:

LoginForm loginForm = (LoginForm) session.getAttribute("loginForm");
String username = loginForm.getUsername();

Of course, it depends on the getXXX method in your LoginForm class AND the
exact name you saved the ActionForm to in the Session scope.

Regards,
David

P.S. I'm suddenly thinking you might have been serious with your first post
about the "Nada" software joke. *very scared*

-----Original Message-----
From: Daniel PC Leung [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 23, 2005 8:40 PM
To: Struts Users Mailing List
Subject: How to get attribute of Form from Controller class?


The following class extends Tiles Controller class.
After user logins, it cannot get the value of login username from the
class LoginForm. How can I change the code so that it can get the
value of login username?

Thnx


          public void perform (ComponentContext context,
                               HttpServletRequest request,
                               HttpServletResponse response,
                               ServletContext servletContext)
                        throws ServletException, IOException {

                HttpSession session = request.getSession();
                session.getAttribute("loginForm.username");

          }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to