aspose file tools*
The moose likes Struts and the fly likes struts2---Update problem:can not get Value from jsp,it shows:nullpointException(in the action) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2---Update problem:can not get Value from jsp,it shows:nullpointException(in the action)" Watch "struts2---Update problem:can not get Value from jsp,it shows:nullpointException(in the action)" New topic
Author

struts2---Update problem:can not get Value from jsp,it shows:nullpointException(in the action)

Ivy chen
Greenhorn

Joined: Aug 31, 2010
Posts: 16
Hello,everyone: thanks for reading this topic,and here is my question.

Question :When i getting value from the jsp,however a nullPointException comes out?below is my code,how does this problem come across?

Here is the steps:
(1).in my project, if one user login successfully (in the 'Login.jsp',i put this user into a session) ,then he can update his profile in the "userUpdate.jsp".
(2).After that, the "UserAction" will deal with it with the new data.

Unfortunately,the "UserAction" can not get the 'session' even and the value from the jsp ,and a NullPointException come out

Note: i try to creat a new action class:"UserUpdateAction" and take the place of the method "UserUpdate" of the "UserAction", the Update become Ok

waiting for your help,thanks and best regards

Below are my codes:

1 . UserAction(a struts2 action):NullPointException come across at line '53' and '54',that is to say:nothing can get from the jsp



2. Here is my "userUpdate.jsp":







Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

You say you are implementing SessionAware but you did not implement setSession.

You should have:

Ivy chen
Greenhorn

Joined: Aug 31, 2010
Posts: 16
Lucas Mireles wrote:You say you are implementing SessionAware but you did not implement setSession.

You should have:



hello Lucas:In fact,in my code, i do have implemented setSession.I just omit the setter and getter in this topic.

the problem still goes on.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2---Update problem:can not get Value from jsp,it shows:nullpointException(in the action)