Re: T5: No root element has been defined

2007-04-21 Thread DigitLiao

I test it. Your html template has no problem.
But where did you put this template?
When I delete test.html, It shows the same error as yours.
The template should be put in the same package as Java file or in WEB-INF/
that match java package from tapestry app root package.



On 4/21/07, Tim Sawyer <[EMAIL PROTECTED] > wrote:


Hi All,

Can someone give me a clue what this means?  I might still be having
supplier
jar trouble, if that's a pointer.

I get this exception when trying to display my first page in my first T5
application:

An unexpected application exception has occurred.

* java.lang.IllegalStateException
  No root element has been defined.

  Stack trace
org.apache.tapestry.dom.Document.toMarkup(Document.java:89)
org.apache.tapestry.internal.services.MarkupWriterImpl.toMarkup(
MarkupWriterImpl.java:51)

org.apache.tapestry.internal.services.PageResponseRendererImpl.renderPageResponse
(PageResponseRendererImpl.java:49)
org.apache.tapestry.internal.services.RootPathDispatcher$1.renderPage(
RootPathDispatcher.java:66)
org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(
PageLinkHandlerImpl.java:89)
org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(
PageLinkHandlerImpl.java:49)
org.apache.tapestry.internal.services.RootPathDispatcher.dispatch (
RootPathDispatcher.java:76)
org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java
:1201)
org.apache.tapestry.internal.services.LocalizationFilter.service(
LocalizationFilter.java:43)
org.apache.tapestry.services.TapestryModule$3.service (TapestryModule.java
:736)
org.apache.tapestry.internal.services.StaticFilesFilter.service(
StaticFilesFilter.java:63)
org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(
CheckForUpdatesFilter.java:91)
org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(
CheckForUpdatesFilter.java:82)
org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(
ConcurrentBarrier.java:77)
org.apache.tapestry.internal.services.CheckForUpdatesFilter.service (
CheckForUpdatesFilter.java:104)
org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java
:1179)
org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:115)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:228)
org.apache.catalina.core.StandardContextValve.invoke (
StandardContextValve.java:175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:104)
org.apache.catalina.core.StandardEngineValve.invoke (
StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
:216)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process (
Http11Protocol.java:634)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
java.lang.Thread.run(Thread.java:595)

What's the file it's trying to parse?  My HTML is simple (not even any Tap

markup), and web.xml looks ok

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

  Title


  The time is not here.




http://java.sun.com/dtd/web-app_2_3.dtd";>

Title

tapestry.app-package
uk.co.title


app
org.apache.tapestry.TapestryFilter


app
/*



Any pointers appreciated!

Tim.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does T5.0.3 support chinese??

2007-04-13 Thread DigitLiao

I added a Filter, and it did succeed.

public void doFilter(ServletRequest arg0, ServletResponse arg1,
   FilterChain arg2) throws IOException, ServletException {
   // TODO Auto-generated method stub
   arg1.setCharacterEncoding("UTF-8");
   arg1.setContentType("text/html; charset=UTF-8");

   arg2.doFilter(arg0, arg1);
   }




http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

hilo Start Page






oo


TT

zzz

中文測 試
 Choose a number from 1 to 10: 

   
   ${index}
   




On 4/13/07, xu yiwei <[EMAIL PROTECTED]> wrote:


The question is the UTF-8 couldn't work!
putting a UTF-8 char in the Start.html will result in a exception.
the "Start.html" is ISO-8859-1 charset default, can I change that? and
How?



2007/4/13, Kevin Lau <[EMAIL PROTECTED]>:
> Well, your question now is not about whether the T5 support Chinese,
it's
> about how to use i18n. You don't even know why you put the "charset=GBK"
> into the template or what's the difference between UTF-8 and GBK.
>
> My suggestion is, forget about the Chinese first, use UTF8 to get the
i18n
> work, then think about the Chinese thing.
>
> On 4/13/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> >
> > 
> > doesn't work right,
> > Exception message:
> > Failure parsing template context:WEB-INF/Start.html: The element type
> > "meta" must be terminated by the matching end-tag "".
> >
> > so I put "" after the  " > content="text/html; charset=GBK"> "
> >
> > Start.html include "The current time is: ${currentTime}.时间 "
> > 时间 means time!
> > Exception message:
> > Failure parsing template context:WEB-INF/Start.html: Invalid byte 1 of
> > 1-byte UTF-8 sequence.
> > The current time is: ${currentTime}.??
> >
> >
> >
> >
> >
> > 2007/4/13, Kevin Lau <[EMAIL PROTECTED]>:
> > >  is for xml file, not for the
html
> > > file.
> > > For the html file, you need to specify the charset by such staff
> > > 
> > >
> > > You really need to learn about the basic before purposeless test...
> > >
> > > On 4/13/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I wtite ""  at the first
line of
> > > > Start.html.
> > > > "现在时间是: ${currentTime}." same as "The current time is:
> > > > ${currentTime}. "
> > > > Something's wrong!
> > > > The exception message:
> > > > Failure parsing template context:WEB-INF/Start.html: Invalid byte
2 of
> > > > 2-byte UTF-8 sequence.
> > > > "?: ${currentTime}."
> > > >
> > > > It couldn't read " a file with the correct charset "
> > > >
> > > >
> > > >
> > > > 2007/4/13, Howard Lewis Ship <[EMAIL PROTECTED]>:
> > > > > T5 does not yet have the logic in place in T4 to allow the
character
> > > > > set to be configured before reading a .properties file or HTML
> > > > > template. For the template, you should be able to set the
charset
> > > > > inside the  tag.
> > > > >
> > > > > The other aspect is output; T5 is hard coded to send, if I
remember
> > > > > correctly, UTF-8, which will be hard pressed to output Chinese
> > > > > properly. So there's problems at both ends: reading a file with
the
> > > > > correct charset, resulting in correct Unicode in memory, then
> > > > > outputting that unicode into the correct charset for the
browser.
> > > > >
> > > > > On 4/12/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> > > > > > *_zh.html could not display chinese!
> > > > > > Doesn't work!
> > > > > >
> > > > > > 2007/4/12, Kevin Lau <[EMAIL PROTECTED]>:
> > > > > > > Use the localization.
> > > > > > >
> > > >
> >
http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
> > > > > > >
> > > > > > > On 4/12/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> > > > > > > >
> > > > > > > >   I am now trying to use T5 to develop a simple system.
> > > > > > > >   but it couldn't display the chinese.
> > > > > > > > This method did not work
> > > > > > > >   configuration.add("tapestry.supported-locales", "zh");
> > > > > > > >   i couldn't write non-ascll chars in the page(Start.html
);
> > > > > > > >
> > > > > > > >   will
> > > > > > > >
> > > > > > > >
> > > >
-
> > > > > > > > To unsubscribe, e-mail:
[EMAIL PROTECTED]
> > > > > > > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > >
.
> > > > > > > Man in the mirror
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Chinese name:徐 依伟
> > > > > > English name: will
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Howard M. Lewis Ship
> > > > > TWD Consulting, Inc.
> > > > > Independent J2EE / Open-Source Java Consultant
> > > > > Creator and PMC Chair, Apache Tapestry
> > > > > Creator, Apache HiveMind
> > > > >
> > > > > Professional Tapestry training, mentoring, support
> > > > > and project work.  http://howardlewisship.com
> > > > >
> > > >
> >