Hi All, I am devolping an application in struts 2 ver 2.0.11. I have created a login screen and back end validation of Username and password. When the user gets validated, I set his username and password in a java bean. Which I want to display on the home screen. But I am unable to do so. My code is given below.
Here is my action class loginCheck.java :
My Business class 'loginVal' :
java bean class 'setUserPass.java' :
And finally my Home page 'home.jsp' :
In the home page if I use 'var' attribute it gives me an error. so I'm bound to use 'Id' tag here. But its still not working with that.
Thanks in advance.
is a new instance of the class, unrelated to the one you populated during execution of your class. This is why you aren't seeing any values for user name and password. In your JSP, the data you have access to is the data that can be obtained for the getter and setter methods of your action class. If you take away your bean tag you'll access these values, but I'm not sure thats the data you are looking for. You probably either want to update the fields in the action class with the values you want to show up on the screen, or put new properties (and thier getters and setters) in your action class for the values you want to display.