Hi people
Not sure if this is the right forum as its a struts\jsp question.
I am new to Java web development. I know Java quite well (applets and command-line apps) but never used it for web tech. I am more used to developing in PHP. Moving over to Struts\JSP is proving harder than I thought. Anyway, here is my problem.
I have a simple form which asks for username and password. Upon submission of said form an Action is called which validates the form input and then forwards to a confirmation page (via the struts-config.xml). One page is used for a successful login and another for an unsuccessful login. All this works well and if the user inputs the username and password I have hard-coded into the Action they get redirected to another JSP page.
FORM --> ACTION --> FINAL JSP
What I need to know is how do I access the information that was entered into the form from the final JSP page? I simply want to display the name the user in-putted on the form.
In PHP I would do something like this
FORM -->
VALIDATE SCRIPT (set up session object to hold input) -->
FINAL PAGE (display info I want from session object)
As I understand it, the info I want my JSP page to access is already in a ActionForm (JavaBean) but I've no idea how to reference it from anything other than my Action object.
I searched around and could only find an example that uses the 'bean:write' tag. Eclipse tells me this is not a recognised tag and nothing is displayed.
I find all of this very unintuitive given that my background is in PHP. Maybe there is a nice tutorial someone knows of that will explain passing data around Struts\JSP web apps?
Thank you very much for your time
Andrew
Not sure if this is the right forum as its a struts\jsp question.
I am new to Java web development. I know Java quite well (applets and command-line apps) but never used it for web tech. I am more used to developing in PHP. Moving over to Struts\JSP is proving harder than I thought. Anyway, here is my problem.
I have a simple form which asks for username and password. Upon submission of said form an Action is called which validates the form input and then forwards to a confirmation page (via the struts-config.xml). One page is used for a successful login and another for an unsuccessful login. All this works well and if the user inputs the username and password I have hard-coded into the Action they get redirected to another JSP page.
FORM --> ACTION --> FINAL JSP
What I need to know is how do I access the information that was entered into the form from the final JSP page? I simply want to display the name the user in-putted on the form.
In PHP I would do something like this
FORM -->
VALIDATE SCRIPT (set up session object to hold input) -->
FINAL PAGE (display info I want from session object)
As I understand it, the info I want my JSP page to access is already in a ActionForm (JavaBean) but I've no idea how to reference it from anything other than my Action object.
I searched around and could only find an example that uses the 'bean:write' tag. Eclipse tells me this is not a recognised tag and nothing is displayed.
I find all of this very unintuitive given that my background is in PHP. Maybe there is a nice tutorial someone knows of that will explain passing data around Struts\JSP web apps?
Thank you very much for your time
Andrew