aspose file tools*
The moose likes JSP and the fly likes problem in accessing the hidden variable from a jsp page. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem in accessing the hidden variable from a jsp page." Watch "problem in accessing the hidden variable from a jsp page." New topic
Author

problem in accessing the hidden variable from a jsp page.

rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
Hi every body.

i am having problem in accesing a hidden variable from a jsp page.

my problem description is



i have a hidden variable "statusHidn" in my jsp page.




i am appending int values of an array into it through javascript function.

the function is as below






now i am trying to access this variable in my servlet as







it is giving null pointer exception when i am trying to assign status[i]=statusInt;


may be there is some problem of String to int conversion. i tried lot's of things but still exception error is coming.

can any body help me please in finding what is the reason for this and what could be the solution.


Thanks and Regards.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Because the status array is null--you never assign it to anything.
rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
hi

initially status[] would be null only.
so what is the solution for this??

Thanks and Regards.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

rammie singh wrote:
so what is the solution for this??


you need to initialize right?. or use ArrayList. but dont use like below

 
 
subject: problem in accessing the hidden variable from a jsp page.