This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am currently working with Java + MYSQL and found following situation.
JSP1 lists the entire records of a table. User can use this screen for listing records or selects a record from the list and modify it. User selects a record from the list and clicks on change button on JSP1 page, which opens a new JSP2 having details the record, which user selected in JSP1. User modifies the record and when hits save button of JSP2, the data should be updated and refreshed list of records should be shown to user.
Problem: I would like to make JSP1 in very generic way so it works fine when user lists only records or refreshes the list after modification.
I have written statements that extract data from JSP2 before listing program. Here JSP1 is executed first and then JSP2 so I get an error of Null pointer exception because JSP1 has not found any data from JSP2 and it�s trying to fetch data from JSP2.
Is there any statement through which, I can check�.
If (request.getParameter(�id�) is NULL) Then ����simply retrieve data Else ����.. fetch data from JSP2 + Update record + retrieve data.
Comments��. I know it�s pretty difficult to explain what I mean.