• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query regarding JSP Page Reports

 
trupti zanjad
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

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,
trupti.
 
Bageshwar Pratap Narain
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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 )
example

<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 !!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!