You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ivan <xh...@gmail.com> on 2010/07/30 10:32:25 UTC
use of default-content-type
Hi, if default-content-type is configured in the web.xml, and in the jsp
file, a differernt content-type is configured, then an exception below is
thrown.
>From the description of the default-content-type, it should take effect
while no content-type is configured in the jsp file, and it should be
allowed to define a different content-type.
Any comment ?
org.apache.jasper.JasperException: /defaultCtype/page1.jsp(17,1) Page
directive: illegal to have multiple occurrences of contentType with
different values (old: text/xml, new: text/html)
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:133)
org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
org.apache.jasper.compiler.Validator.validateDirectives(Validator.java:1733)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:195)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:360)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
--
Ivan
Re: use of default-content-type
Posted by Mark Thomas <ma...@apache.org>.
On 01/08/2010 14:19, Ivan wrote:
> Any comment ?
That would be a bug. Please create a bugzilla entry for it.
Mark
> Thanks !
>
> 2010/7/30 Ivan <xh...@gmail.com>
>
>> Tomcat 7
>>
>> 2010/7/30 Mark Thomas <ma...@apache.org>
>>
>> On 30/07/2010 09:32, Ivan wrote:
>>>> Hi, if default-content-type is configured in the web.xml, and in the jsp
>>>> file, a differernt content-type is configured, then an exception below
>>> is
>>>> thrown.
>>>> From the description of the default-content-type, it should take effect
>>>> while no content-type is configured in the jsp file, and it should be
>>>> allowed to define a different content-type.
>>>> Any comment ?
>>>
>>> Tomcat version?
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> --
>> Ivan
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: use of default-content-type
Posted by Ivan <xh...@gmail.com>.
Any comment ?
Thanks !
2010/7/30 Ivan <xh...@gmail.com>
> Tomcat 7
>
> 2010/7/30 Mark Thomas <ma...@apache.org>
>
> On 30/07/2010 09:32, Ivan wrote:
>> > Hi, if default-content-type is configured in the web.xml, and in the jsp
>> > file, a differernt content-type is configured, then an exception below
>> is
>> > thrown.
>> > From the description of the default-content-type, it should take effect
>> > while no content-type is configured in the jsp file, and it should be
>> > allowed to define a different content-type.
>> > Any comment ?
>>
>> Tomcat version?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> --
> Ivan
>
--
Ivan
Re: use of default-content-type
Posted by Ivan <xh...@gmail.com>.
Tomcat 7
2010/7/30 Mark Thomas <ma...@apache.org>
> On 30/07/2010 09:32, Ivan wrote:
> > Hi, if default-content-type is configured in the web.xml, and in the jsp
> > file, a differernt content-type is configured, then an exception below is
> > thrown.
> > From the description of the default-content-type, it should take effect
> > while no content-type is configured in the jsp file, and it should be
> > allowed to define a different content-type.
> > Any comment ?
>
> Tomcat version?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Ivan
Re: use of default-content-type
Posted by Mark Thomas <ma...@apache.org>.
On 30/07/2010 09:32, Ivan wrote:
> Hi, if default-content-type is configured in the web.xml, and in the jsp
> file, a differernt content-type is configured, then an exception below is
> thrown.
> From the description of the default-content-type, it should take effect
> while no content-type is configured in the jsp file, and it should be
> allowed to define a different content-type.
> Any comment ?
Tomcat version?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: use of default-content-type
Posted by Ivan <xh...@gmail.com>.
No, it is just a simple jsp file.
I guess that current codes could not handle the default-content-type and the
scenario you mentioned, it seems that it configured the value of
default-content-type to the content-type attribute while constructing the
PageInfo instance.
2010/7/30 LiuYan 刘研 <lo...@21cn.com>
>
> Just a guess, does page1.jsp include another page2.jsp and page2.jsp does
> not
> specify content-type(which will be default-content-type)?
>
>
> Ivan Xu wrote:
> >
> > Hi, if default-content-type is configured in the web.xml, and in the jsp
> > file, a differernt content-type is configured, then an exception below is
> > thrown.
> > From the description of the default-content-type, it should take effect
> > while no content-type is configured in the jsp file, and it should be
> > allowed to define a different content-type.
> > Any comment ?
> >
> > org.apache.jasper.JasperException: /defaultCtype/page1.jsp(17,1) Page
> > directive: illegal to have multiple occurrences of contentType with
> > different values (old: text/xml, new: text/html)
> >
> >
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
> >
> >
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
> >
> >
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
> >
> >
> org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:133)
> > org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
> > org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
> > org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
> > org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
> > org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
> > org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
> >
> >
> org.apache.jasper.compiler.Validator.validateDirectives(Validator.java:1733)
> > org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:195)
> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:360)
> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
> >
> >
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
> >
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> >
> >
> > --
> > Ivan
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/use-of-default-content-type-tp29303906p29304084.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Ivan
Re: use of default-content-type
Posted by LiuYan 刘研 <lo...@21cn.com>.
Just a guess, does page1.jsp include another page2.jsp and page2.jsp does not
specify content-type(which will be default-content-type)?
Ivan Xu wrote:
>
> Hi, if default-content-type is configured in the web.xml, and in the jsp
> file, a differernt content-type is configured, then an exception below is
> thrown.
> From the description of the default-content-type, it should take effect
> while no content-type is configured in the jsp file, and it should be
> allowed to define a different content-type.
> Any comment ?
>
> org.apache.jasper.JasperException: /defaultCtype/page1.jsp(17,1) Page
> directive: illegal to have multiple occurrences of contentType with
> different values (old: text/xml, new: text/html)
>
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
>
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
>
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
>
> org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:133)
> org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
> org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
> org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
> org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
>
> org.apache.jasper.compiler.Validator.validateDirectives(Validator.java:1733)
> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:195)
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:360)
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
>
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>
>
> --
> Ivan
>
>
--
View this message in context: http://old.nabble.com/use-of-default-content-type-tp29303906p29304084.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org