• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Rereshing after modification / Listing

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Any help will be appreciated...

Ranch Hand
Posts: 473
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Using javascript window.opener code on close button of JSP2
like this...

on_Click="javascript:window.opener.window.history.go(0) ;window.close() "

This will reload JSP1 page and close the JSP2

Hope it works for you

Sorry I cannot show you the correct javascript due to restriction on this forum!

Maki Jav
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Try to find some good articles and books on using MVC and Front Controller pattern, that is what you need to write generic, easily extended and managed web apps.

Here's a link that looks promising front controller pattern

You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!