• 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

My servlet do not generate report created in jaspersoft studio

 
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have created a report in jaspersoft studio, in this reports I have four fields and one parameter, the parameter is to be receive the date to select records in mysql db sent by hashmap in my servlet. The problem is that, when I click in the preview button of jaspersoft studio screen and I inform the date desired, the preview show me the records of my mysql db without problem. But, when I execute my servlet to generate the report I not generate the report and I do not receive any type of error.

This is jrxml of the report:

And this is my servlet class:

Thanks in advance for help.
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a processRequest(...) method declared. And in its comments it says



This is not correct. It actually does nothing. So if you submit a GET request, you'll get nothing. (Which appears to be what is happening.) You will only get something returned if you submit a POST request. (Warning: I haven't looked at your doPost(...) method in case I was right already.)

It's better not to use the trick where doGet and doPost both call a method which does the actual work. For one thing you normally shouldn't have GET and POST requests which do the same thing.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul thanks by help.
Sorry for not explain well. I have an jsp that call my servlet.

This jsp are calling the servlete ok, but my servlet do not execute my report.
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I search the web I see a lot of pages which suggest that a <button> element always uses the GET method, regardless of what the <form> says which contains the <button>. They also suggest you use <input type="submit"> instead.

If they are right, and I expect they are, then my original post which points out that your servlet does nothing for GET requests is also right.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul are you right. I have button to generate my report.
My problem is in:

If I take out the condition 'WHERE' of 'SELECT' the report is generated, 'paramDtaEletro' is an especific date that is passed to search on my db.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry to everyone. I solved the problem. I have defined in the HashMap parameters of my servlet different of condition 'WHERE'.

Once again, sorry.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!