Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ivy chen
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
IntelliJ IDE Java Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say you are implementing SessionAware but you did not implement setSession.

You should have:

 
Ivy chen
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic