Since the content-type header tells the client browser what type of input
to expect, it doesn't make sense to send more than one of them in response
to each request.
On Wed, 3 Nov 1999, Tom John wrote:
> Hi,
>
> What I wan't to know is that by any chance if I want to use the
> setContentType twice How can I do it.It gives (have a look at the following
> code)
> errors but if I pass the res object(which is declared in UdpateExam)as
> getMaxExamId(HttpServletResponse res) it works. Why is that?
>
> Other Question is,
> Let me know what is the meaning of setContentType can be used once. Does it
> to a particular object
> or what.
>
>
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> class TimeTable{
>
> ....
> ....
>
> //---------------
> public long getMaxExamId() throws ServletException,IOException
> {
> ...
> ...
> HttpServletResponse res1=null;
> res1.setContentType("text");
> PrintWriter out=res.getWriter();
> .......
>
> ......
>
>
> }
> //----------------
>
>
> public void UdpateExam(HttpServletResponse res) throws
> ServletException,IOException
> {
> ResultSet rs=null;
> res.setContentType("text/html");
> PrintWriter out=res.getWriter();
>
> ...
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html