You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by worookie <wo...@hotmail.com> on 2003/06/13 03:21:49 UTC
how to add a new page component?
What I am trying to do is to extend Harish's demo Registration app.
In his demo, there is a simple page component called "Confirmation" which
has only the Confirmation.html file. There are no .java file or .page for
it.
Then, I added the following 2 files to the application:
Confirmation.java:
=============================================
package net.cc.hk;
import java.io.*;
import org.apache.tapestry.*;
import org.apache.tapestry.html.*;
public abstract class Confirmation extends BasePage {
public IMarkupWriter getResponseWriter(OutputStream out) {
return new HTMLWriter("text/html;charset=Big5", out);
}
}
Confirmation.page
=============================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<page-specification class="net.cc.hk.Confirmation">
</page-specification>
=============================================
While running the app and accessing to the Confirmation page, the following
exception occurred:
org.apache.tapestry.ApplicationRuntimeException
Unable to instantiate an instance of class net.cc.hk.Confirmation.
location: context:/WEB-INF/Confirmation.page, line 6
......
=============================================
I also tried to add one more line (for the Confirmation page's info) in the
Registration.application file as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<application name="Demo Registration Application">
<page name="Home" specification-path="Registration.page"/>
<page name="Confirmation" specification-path="Confirmation.page"/>
</application>
But no luck either.
==============================================
I didn't change the Confirmation.html of which the contents are:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Tapestry Demo Registration</title>
<link rel="stylesheet" type="text/css" href="css/Registration.css"/>
</head>
<body>
<div align="center">
<h1>Registration is successful!</h1>
<a href="#" jwcid="@PageLink" page="Registration">Next Registration</a>
</div>
</body>
</html>
===============================================
So, what did I miss?
Thanks in advance.
Regards,
Rookie
Re: how to add a new page component? [SOLVED]
Posted by worookie <wo...@hotmail.com>.
----- Original Message -----
From: "Bill Lear" <ra...@zopyra.com>
> >public abstract class Confirmation extends BasePage {
>
> Why abstract?
>
>
> Bill
Thanks a million! -Rookie
Re: how to add a new page component?
Posted by Bill Lear <ra...@zopyra.com>.
On Thursday, June 12, 2003 at 18:21:49 (-0700) worookie writes:
>What I am trying to do is to extend Harish's demo Registration app.
>
>In his demo, there is a simple page component called "Confirmation" which
>has only the Confirmation.html file. There are no .java file or .page for
>it.
>
>Then, I added the following 2 files to the application:
>
>Confirmation.java:
>=============================================
>
>package net.cc.hk;
>
>import java.io.*;
>import org.apache.tapestry.*;
>import org.apache.tapestry.html.*;
>
>public abstract class Confirmation extends BasePage {
Why abstract?
Bill