• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Query regarding JSP Page Reports

Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I want to report in jsp, so is it possible to call n number of jsp pages by writing only 2 pages of jsp
1> on one page i will have list of reports, as the user clicks any report he/she wants,
2> on second page the data will be displayed for that particular report.
please guide me on this topic.
thank you,
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, try not to write individual JSP pages for generating reports,
what use is , then Server Side scripting, when you have to code everthing statically,
why not try a different approach and generate the required pages on the fly. That will be the best aproach.

Anyways , as you have posed your problem,
this is what i might have done to solve this :

Depending upon the number of reports ( a few 10-20 to 500-1000)
i would have created a map in the database, or used a xml file.
I think creating a table would be the best option,
that ways, you can add loads of more information apart from the link --> jsp page mapping.

In the first JSP page, connect to the database / XML file and fetch all the links (link to the 2nd JSP )

<a href="showReport.jsp?id=XXX" >Report Label</a>

The text in bold , should come from the database,

then in the showReport.jsp page, simply extract the GET request paramter "id" and fetch the mapped JSP page from the database / XML.
Then use request.getRequestDispatcher(" jsp page "), to forward the request to the required JSP page

I hope I am clear enough
Cheers !!!
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic