Hi Dipita,
Dipita Shah wrote:
I am trying to figure out if I can configure two html pages map to the same java
source file
Yep this is supported. You need to manually map the templates to the
Page in click.xml:
<click-app charset="UTF-8">
<pages package="com.mycorp.page">
<page path="customer.htm" classname="CustomerPage"/>
<page path="customer2.htm" classname="CustomerPage"/>
</pages>
</click-app>
It might even work with automapping (haven't tested) so you only need
to declare the following (by default customer.htm -> CustomerPage
should be mapped automatically):
<click-app charset="UTF-8">
<pages package="com.mycorp.page">
<page path="customer2.htm" classname="CustomerPage"/>
</pages>
</click-app>
There are some limitations when using multiple templates though. For
example you cannot use the methods:
getContext().getPagePath(Page.class);
getContext().createPage(Page.class);
If you do it will throw an exception that Click doesn't know which
template to use. Instead you will need to use the overloaded methods
which accepts the path as argument:
getContext().getPagePath(String template);
getContext().createPage(String template);
kind regards
bob