This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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?
 
Sheriff
Posts: 23963
50
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: 3794
40
  • 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.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!