File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there something wrong with the RequestDispatcher?

 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's my code ...



the problem is at line no. 5

here's my xml document

 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are doing a forward using RequestDispatcher, the JSP which does the forward cannot write any content of its own. Either move this forward as the first line of the JSP page or use an include. Also the logic that you are using in the JSP should not be in a JSP, its not a good design. You can pass your request through either a servlet or a filter which will do this processing...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sigh.

The time is long past to stop writing JSPs like it's still 2001. You should not be placing Java code in a JSP... especially code of this nature.

There's is a reason that things have changed; this is one of them

 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i do not know why ... but its the same code and its working fine now ...



@ Mr. Bear

I am not doing it for some real application ... it was just an experiment code ...
and yes I do take care not to write bad things at bad places ...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic