• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Redisplay info when a user goes back to previous page

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having trouble redisplaying the information the user entered on a previous screen.
I have a "prev" and "next" bottom.
If the user wants to correct some information on the "prev" screen. Upon their return, the information is gone and they have to re-enter the information?!?
If I do a <jsp:getProperty> I get an null object exception.
Any help/suggestions/sample code?
Thanks much!
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to save the request from the current page in e.g. a HashMap in e.g. Session. Then run the Map through when you 'reenter' the page and parse the values to the fields.
/Rene
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, I'm a newbie so that is part of the problem.
I am using a session, whether I'm setting it up right is another question.
The exception comes on the first time thru when I make a call to the Bean and I get the exception:
org.apache.jasper.JasperException: Attempted a bean operation on a null object.
On the call to:
<jsp:getProperty name="customer" property="firstName" />
This probably isn't enough information but any ideas???
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a question - do you only use JSP or are you in for Servlet as well?
/Rene
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've made a sample:
first.jsp

second.jsp, next.jsp....

HelperBean.java

Just to give you an idea.
/Rene
[ July 17, 2002: Message edited by: Rene Larsen ]
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help!
I am using a servlet, JSPs & a bean.... Haven't worked, much, with hashmaps but i'm getting there.....
So, I have 3 JSPs a contact.jsp, a contactInfo.jsp and a contactDisplay.jsp, along with the Contact(servlet) and ContactCustomer(bean). When I fill out the contact page the request is then forwarded to the contactInfo.jsp when I hit "prev" to go back and edit, everything is gone.
It's gotta be something simple but.........
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, as I can read from your post, the sample I just gave you will fulfil what you need
/Rene
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic