This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

servlet dont redirect to a jsp page  RSS feed

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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: 24191
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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: 506
15
Java Notepad
  • Mark post as helpful
  • send pies
  • 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: 3928
45
  • Mark post as helpful
  • send pies
  • 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.
 
We don't have time for this. We've gotta save the moon! Or check this out:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!