• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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":







 
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic