• 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

Getting error

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


I tried to get selected value into my Servlet page but I did n't able to get the selected value.Am getting exception.Please give me
solution to solve this problem.First i run my operator.jsp .This page contains two frames.In left side am getting values from database
through radio button.In right side of the page contains text box and submit button.If i select any radio button value and give input into
text box when submit the transfer or hold button clicked the corresponding action will be performed into my Servlet page.But i should n't able to run successfully.Am getting the Null pointer Exception.

This is my JSP code operator.jsp



refresh1.jsp




The final one is Servlet code...
MainServlet.java


The following error message will be getting...
java.lang.NullPointerException
MainServlet.doGet(MainServlet.java:35)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Regards,
Suganya.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In which line does the exception occur? Which object is null?
 
R Sugan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I should not able to get the selected radio button value in my servlet page and am getting the values from Jsp page using this function.

String callerid=request.getParameter("callerid");
out.print(callerid);


Regards,
Suganya
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not following. Both JSPs have a form field "callerid", so I would expect to be able to get a value. Why do you think otherwise?

I'm also still not clear on which line throws the exception, and which object is null - the "callerid" parameter? If you don't expect a value to be transmitted then that should not be a surprise.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


in your first jsp , you have hidden field right?



i guess your callerid value is not set in javascript properly.
 
R Sugan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I change that field <input type="hidden" name="idtemp" id="idtemp"/> now i get null values...Please help me..
How to solve this problem...


Regards,
Suganya
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic