?
Solved

not again............

Posted on 2003-03-14
7
Medium Priority
?
149 Views
Last Modified: 2010-04-01
hey all,

ive been trying to figure out how to solve a problem i am having

1)-java.lang.NullPointerException

i get this problem when a user does not check a box (multiple test exam), and thus does not update the persons results in the databse.

How can i solve this??? anyone have any idea?

2) i was wondering how (using jsp and html) can i send a question to a user one at a time( the q are stored in an array), get the answer from the user , process the answer if correct go on to next q and repeat process, if wrong go to solution and how it is worked out page then after the user has read solution they can click on a carry on which will take them on to the next q. and the process continues untiul q finish.

i was thinking of doing it in a html page with frames the first being a jsp page which displays the q and the second being where the user can input their answers.

can neone help me out????

if so v grateful.

thanku ill.
0
Comment
Question by:illinosis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 8138826
>> 1)-java.lang.NullPointerException i get this problem when a user does not check a box (multiple test exam).

if( request.getParameter( "checkboxname" ) == null ) {
   // user didn't check the check box.
   // you must handle this situation, otherwise NullPointerException.
}

>> 2) ....
you can save the current question number in the session:

store:
session.setAttribute( "questionNo", new Integer( questionNo ) );

retrieve:
Integer temp = ((Integer)session.getAttribute( "questionNo" ));
if( temp != null ) questionNo = temp.intValue();

BTW, you haven't follow up on your other questions for a long while, if you keep leaving your questions open without any update, you might find it is difficult to get help in future :)
0
 

Author Comment

by:illinosis
ID: 8139716
kennethxu ...thanx 4 ure help will try out tmor.

>>BTW, you haven't follow up on your other questions for a long while, if you keep leaving your questions open without any update, you might find it is difficult to get help in future :)

im soz...when a q is answered and it helps i reward the points and thank the all the peps 4 their help. i will post up updates from now on (i didnt realise this b4
:( ...if u tell me the q that u wud like the update on i will go back to that q and post an update (i didnt realise people still viewed them after they had been answered)...

Thanku...and i will post u an update on this q tmor.

Ill
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8139810
just click on your name, you'll get the list of Q's belong to you. anyway this is the link:
http://www.experts-exchange.com/Web/Web_Languages/JSP/memberProfile.jsp?mbr=illinosis

it's better to let people know what's the result after you trid their comment, it given solution doesn't work, experts might give you another solution :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:illinosis
ID: 8143627
Hey kennethxu,

the exception handling worked.

But i am not too sure wat you mean for my second q. I get wat ure trying to say about session. but i dont get how to fire each q, from one page etc..i think i am getting confused.:(
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 280 total points
ID: 8145588
whatever you stored as session attribute can be accessed from page to page. so you can trace which is current, which is next.
0
 
LVL 35

Expert Comment

by:girionis
ID: 10041172
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to kennethxu

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question