Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

servlet dont redirect to a jsp page

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from a jsp redirected page to a servlet, this redirects to another jsp page, but when I click the submit button, the form deletes all data and does not redirect.

The resulting address is:

http://localhost:8080/ClienteWebParking/parquear.do?nombre=ives&tipo=carro&placa=aws-128&horain=10%3A00&horaout=12%3A00&fecha=2018-05-31&Reserva=reserva

this is the index.jsp


   
this is servlet Parquear

 

I've tried the following options but it does not work:


       

this is reserva.jsp


on this page you must show the data entered in the form

What should I change so that it can be redirected from the servlet to reserva.jsp?
 
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me point out that it's common for a servlet to forward to a JSP. However you have chosen to redirect instead of forwarding; was that a specific requirement which somebody gave to you? If not, I'd suggest changing the servlet to forward to the JSP after it completes its work.
 
Rancher
Posts: 509
15
Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

from a jsp redirected page to a servlet, this redirects to another jsp page, but when I click the submit button, the form deletes all data and does not redirect...



So the navigation is: index.jsp -> Parquear servlet -> reserva.jsp

1. The servlet Parquear: can you tell the configuration of the servlet in the web.xml
2. Place a debug statement in Parquear like a log or System.out.println("I am in the Parquear...") and verify the log files/console and see this debug output is appearing.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you see anything in your logs (for example do either of the messages in the catch blocks appear)?
If not, as Prasad says, add some logging into the servlet so you can at least see where in the code it is going, and what values it is dealing with.
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic