User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 375,249 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,159 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1268 | Replies: 4
Reply
Join Date: Apr 2007
Posts: 4
Reputation: ramakrishna172 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ramakrishna172 ramakrishna172 is offline Offline
Newbie Poster

<%@include file>

  #1  
Apr 13th, 2007
why include file can not modify the header and cookies.can tell the reason.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: <%@include file>

  #2  
Apr 13th, 2007
What are you referring to? typically the problem with include files is that the response buffer either contains data already or has been sent... you can't change what is buffered or sent but you can add to it... if the buffer is not sent then you can clear it, which erases it and allows you to start over... I always do a response.resetBuffer() prior to forwarding pages, for example, so that I am sure I can forward without trouble... it is also a goot idea to do a check to see if the buffer is comitted prior to clearing it... you can't clear if it is sent... of course... so doing so will throw an error...

Peace,
Reply With Quote  
Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: <%@include file>

  #3  
Apr 13th, 2007
Again, perhaps I can help more if you provide more details about what you are trying to do...
Reply With Quote  
Join Date: Apr 2007
Posts: 4
Reputation: ramakrishna172 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ramakrishna172 ramakrishna172 is offline Offline
Newbie Poster

Re: <%@include file>

  #4  
Apr 13th, 2007
Originally Posted by rgtaylor View Post
Again, perhaps I can help more if you provide more details about what you are trying to do...


i have one page(main.jsp) ,another page (includepage.jsp)

main.jsp :

<%@ include file="includepage.jsp">

why include page cannot modify /set cookie or headers.
Reply With Quote  
Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: <%@include file>

  #5  
Apr 13th, 2007
see my first post above... unfortunately for JSP the return characters at the end of each line are sent to the response buffer, so by the time you get to you include directive, you already have content in the response buffer... this can cause trouble... unless I am misunderstanding your problem... in which case I want to help, but you can't be stingy with the details...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 4:51 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC