File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP request forwarding

 
Haritha Gorijavolu
Greenhorn
Posts: 21
Debian Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am building an application using JSPs. There is a lot of data to be retrived from database and displayed in some JSPs. To make the code more readable and easy to debug, I want to delegate the retrival and display of some information to some code other than the present JSP. Some thing like request forwarding. I don't want to go for request forwarding to another JSP or servlet because the rest of the statements won't execute in the calling page. Even if I use include(request,response), the output is not what I wanted.
I want a mechanism where I can forward some parameters to some code and the code prints response at the palce where it's called in the calling JSP and after printing the response the rest of the calling JSP code continues to execute.
Is it advisable to do the following:
Set the parameters I want to forward as session attributes and use <% include file= %> to do the processing by retriving the session attributes in that file and print response at the place where the file is included.
Please suggest some thing.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the up-front work of collecting data should be done in a servlet controller. The data is place in request scope for retrieval and display by the JSP.

Please read this article for more information.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic