aspose file tools*
The moose likes Servlets and the fly likes Unable to redirect the page through dispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Unable to redirect the page through dispatcher" Watch "Unable to redirect the page through dispatcher" New topic
Author

Unable to redirect the page through dispatcher

Padhma Prema
Greenhorn

Joined: Dec 23, 2008
Posts: 15
Hello,

I have the below code. Its a shopping cart, being done via MVC.
The below is the controller code and below it is the bean code.

When I add an item and try to click on view cart, it is supposed to go to processViewAction in the controller and retrive the items added from the latest cart and redirect to view cart.jsp and display the cart....

but it wont, it gives me a internal error. could someone throw some light on this please.




the bean code:



viewcart.jsp


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Padhma Prema wrote: it gives me a internal error. could someone throw some light on this please.

Please read this.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Padhma Prema
Greenhorn

Joined: Dec 23, 2008
Posts: 15
Sorry, my mistake. I should have been more clear.

What is supposed to happen:

I have a .html page - where there are 5 check box options to pick and add them to cart.
there is a add to cart button.

on the click of add to cart,it contact the controller, a new session is created, add's the added items to cart, addsthe result to the bean and i add the b ean to the session and using request dispatcher, the check marked items will get displayed in itemsAdded.jsp

There is a view cart button in this itemsadded.jsp, on the click of view cart, it goes back to the cocntroller, gets the data from the bean and request dispatcher the added items are displayed in the cart via the viewcart.jsp page specified in request dispatcher.

What happens:
On the click on view cart button in itemsAdded.jsp, it gives me a error code 500 pointing to processViewAction and says null point exception. i am unable to figure out the null point here.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Look at the stack trace (which you should always post). it will tell what line number the NPE occurred on.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to redirect the page through dispatcher
 
Similar Threads
help for shopping cart
How to store multiple items into a shopping cart?
Storing of Data
Online Shopping
Problem with c:forEach Tag