You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by CIJOML <ci...@volny.cz> on 2006/08/23 19:50:25 UTC
How to be redirected from login form to BasePage?
Hi,
I wrote little application which now I want secure.
So I developped login form, but I am unable to be redirected to BasePage after
successfull login.
When I call such page directly in DP.application, it renders:
<!DOCTYPE application PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<!-- generated by Spindle, http://spindle.sourceforge.net -->
<application name="DP" engine-class="org.apache.tapestry.engine.BaseEngine">
<description>DP Michal Semler</description>
<page name="Home" specification-path="Home.page"/> <!-- uvodni stranka -->
<library id="contrib"
specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
<library id="menu"
specification-path="/org/krysalis/menu/component/Menu.library"/>
</application>
But when I change Home.page to Login.page, it returns errors:
Login process goes OK, and then I don't know how to call from cycle.activate
my Home.page:
My Login.java
-------------
package org.cijoml.ui.pages;
import java.sql.SQLException;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.IPage;
import org.apache.tapestry.html.BasePage;
import org.cijoml.utils.IBatisUtil;
import org.cijoml.model.Administrator;
import com.ibatis.sqlmap.client.SqlMapClient;
public abstract class Login extends BasePage {
public abstract String getNick();
public abstract String getHeslo();
public abstract void setZprava(String zprava);
public void login(IRequestCycle cycle) throws SQLException
{
if (isValidLogin(getNick(), getHeslo())) {
cycle.activate("Home.page");
return;
}
setZprava("Spatne jmeno nebo heslo!!!");
}
private boolean isValidLogin(String nick, String heslo) throws SQLException {
return true; //this is not important for this case
}
}
------------
Login.html:
<html jwcid="@Shell" title="Prihlaseni">
<body>
<span jwcid="@Conditional" condition="ognl:zprava">
<font color=red>
<span jwcid="@Insert" value="ognl:zprava">
Error Message
</span>
</font>
</span>
<p>
<form jwcid="@Form" listener="ognl:listeners.login">
<table>
<tr>
<th>Jmeno Administratora: </th>
<td>
<input type="text" jwcid="@TextField" value="ognl:nick"
size="30"/>
</td>
</tr>
<tr>
<th>Heslo: </th>
<td>
<input type="password" jwcid="@TextField" value="ognl:heslo"
hidden="ognl:true" size="30"/>
</td>
</tr>
<tr>
<td><input type="submit" value="Login"/></td>
</tr>
</table>
</form>
</body>
</html>
Login.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">
<!-- generated by Spindle, http://spindle.sourceforge.net -->
<page-specification class="org.cijoml.ui.pages.Login">
<property-specification name="zprava" type="java.lang.String"/>
<property-specification name="nick" type="java.lang.String"/>
<property-specification name="heslo" type="java.lang.String"/>
</page-specification>
Thanks a lot for help!
Michal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Re: How to be redirected from login form to BasePage?
Posted by Sam Gendler <sg...@ideasculptor.com>.
The previously mentioned Enjoy Web Development with Tapestry 4 book is
great, and the Tap in Action book is still very relevant to tap 4.
Going with tap 3 now would be a mistake. Tap 4 was a big improvement
and most of the available component libraries and such don't support
Tap 3 any longer.
--sam
On 8/25/06, CIJOML <ci...@volny.cz> wrote:
> Hmmm my good friends uses T3 version and never worked with T4. I bought book
> Tapestry in action which is about T3...if you can recommend any book about
> T4, I can think about this revission.
>
> Thanks a lot
>
> Michal
>
> Dne čtvrtek 24 srpen 2006 22:43 hv @ Fashion Content napsal(a):
> > If you are starting fresh why not base your app on Tap4 ?
> >
> > "CIJOML" <ci...@volny.cz> skrev i en meddelelse
> > news:200608241657.03199.cijoml@volny.cz...
> > Hi Ron,
> >
> > thanks very much, It helped me a lot! I had to do more changes ;)
> > <page name="Login" specification-path="Login.page"/>
> > I forgot rename also page name! :(
> >
> > Thank you - probably a lot more questions will continue, while I am new to
> > Tapestry kingdom :)
> >
> > Michal
> >
> > Dne čtvrtek 24 srpen 2006 16:19 Ron Piterman napsal(a):
> > > its cycle.activate("Home");
> > >
> > > Cheers,Ron
> > >
> > > CIJOML wrote:
> > > > Hi,
> > > >
> > > > I wrote little application which now I want secure.
> > > > So I developped login form, but I am unable to be redirected to
> > > > BasePage after successfull login.
> > > >
> > > > When I call such page directly in DP.application, it renders:
> > > >
> > > > <!DOCTYPE application PUBLIC
> > > > "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> > > > "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> > > > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> > > >
> > > > <application name="DP"
> > > > engine-class="org.apache.tapestry.engine.BaseEngine"> <description>DP
> > > > Michal Semler</description>
> > > > <page name="Home" specification-path="Home.page"/> <!-- uvodni
> > > > stranka --> <library id="contrib"
> > > > specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
> > > > <library id="menu"
> > > > specification-path="/org/krysalis/menu/component/Menu.library"/>
> > > > </application>
> > > >
> > > > But when I change Home.page to Login.page, it returns errors:
> > > >
> > > > Login process goes OK, and then I don't know how to call from
> > > > cycle.activate my Home.page:
> > > >
> > > > My Login.java
> > > > -------------
> > > > package org.cijoml.ui.pages;
> > > >
> > > > import java.sql.SQLException;
> > > >
> > > >
> > > > import org.apache.tapestry.IRequestCycle;
> > > > import org.apache.tapestry.IPage;
> > > > import org.apache.tapestry.html.BasePage;
> > > > import org.cijoml.utils.IBatisUtil;
> > > > import org.cijoml.model.Administrator;
> > > >
> > > > import com.ibatis.sqlmap.client.SqlMapClient;
> > > >
> > > >
> > > > public abstract class Login extends BasePage {
> > > >
> > > > public abstract String getNick();
> > > > public abstract String getHeslo();
> > > > public abstract void setZprava(String zprava);
> > > >
> > > > public void login(IRequestCycle cycle) throws SQLException
> > > > {
> > > > if (isValidLogin(getNick(), getHeslo())) {
> > > > cycle.activate("Home.page");
> > > >
> > > > return;
> > > > }
> > > > setZprava("Spatne jmeno nebo heslo!!!");
> > > > }
> > > >
> > > > private boolean isValidLogin(String nick, String heslo) throws
> > > > SQLException { return true; //this is not important for this case
> > > > }
> > > > }
> > > > ------------
> > > >
> > > > Login.html:
> > > >
> > > > <html jwcid="@Shell" title="Prihlaseni">
> > > > <body>
> > > > <span jwcid="@Conditional" condition="ognl:zprava">
> > > > <font color=red>
> > > > <span jwcid="@Insert" value="ognl:zprava">
> > > > Error Message
> > > > </span>
> > > > </font>
> > > > </span>
> > > >
> > > > <p>
> > > >
> > > > <form jwcid="@Form" listener="ognl:listeners.login">
> > > >
> > > > <table>
> > > > <tr>
> > > > <th>Jmeno Administratora: </th>
> > > > <td>
> > > > <input type="text" jwcid="@TextField" value="ognl:nick"
> > > > size="30"/>
> > > > </td>
> > > > </tr>
> > > >
> > > > <tr>
> > > > <th>Heslo: </th>
> > > > <td>
> > > > <input type="password" jwcid="@TextField"
> > > > value="ognl:heslo" hidden="ognl:true" size="30"/>
> > > > </td>
> > > > </tr>
> > > >
> > > > <tr>
> > > > <td><input type="submit" value="Login"/></td>
> > > > </tr>
> > > > </table>
> > > > </form>
> > > > </body>
> > > > </html>
> > > >
> > > > Login.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">
> > > > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> > > >
> > > > <page-specification class="org.cijoml.ui.pages.Login">
> > > >
> > > > <property-specification name="zprava" type="java.lang.String"/>
> > > > <property-specification name="nick" type="java.lang.String"/>
> > > > <property-specification name="heslo" type="java.lang.String"/>
> > > >
> > > > </page-specification>
> > > >
> > > > Thanks a lot for help!
> > > >
> > > > Michal
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: How to be redirected from login form to BasePage?
Posted by CIJOML <ci...@volny.cz>.
Hmmm my good friends uses T3 version and never worked with T4. I bought book
Tapestry in action which is about T3...if you can recommend any book about
T4, I can think about this revission.
Thanks a lot
Michal
Dne čtvrtek 24 srpen 2006 22:43 hv @ Fashion Content napsal(a):
> If you are starting fresh why not base your app on Tap4 ?
>
> "CIJOML" <ci...@volny.cz> skrev i en meddelelse
> news:200608241657.03199.cijoml@volny.cz...
> Hi Ron,
>
> thanks very much, It helped me a lot! I had to do more changes ;)
> <page name="Login" specification-path="Login.page"/>
> I forgot rename also page name! :(
>
> Thank you - probably a lot more questions will continue, while I am new to
> Tapestry kingdom :)
>
> Michal
>
> Dne čtvrtek 24 srpen 2006 16:19 Ron Piterman napsal(a):
> > its cycle.activate("Home");
> >
> > Cheers,Ron
> >
> > CIJOML wrote:
> > > Hi,
> > >
> > > I wrote little application which now I want secure.
> > > So I developped login form, but I am unable to be redirected to
> > > BasePage after successfull login.
> > >
> > > When I call such page directly in DP.application, it renders:
> > >
> > > <!DOCTYPE application PUBLIC
> > > "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> > > "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> > > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> > >
> > > <application name="DP"
> > > engine-class="org.apache.tapestry.engine.BaseEngine"> <description>DP
> > > Michal Semler</description>
> > > <page name="Home" specification-path="Home.page"/> <!-- uvodni
> > > stranka --> <library id="contrib"
> > > specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
> > > <library id="menu"
> > > specification-path="/org/krysalis/menu/component/Menu.library"/>
> > > </application>
> > >
> > > But when I change Home.page to Login.page, it returns errors:
> > >
> > > Login process goes OK, and then I don't know how to call from
> > > cycle.activate my Home.page:
> > >
> > > My Login.java
> > > -------------
> > > package org.cijoml.ui.pages;
> > >
> > > import java.sql.SQLException;
> > >
> > >
> > > import org.apache.tapestry.IRequestCycle;
> > > import org.apache.tapestry.IPage;
> > > import org.apache.tapestry.html.BasePage;
> > > import org.cijoml.utils.IBatisUtil;
> > > import org.cijoml.model.Administrator;
> > >
> > > import com.ibatis.sqlmap.client.SqlMapClient;
> > >
> > >
> > > public abstract class Login extends BasePage {
> > >
> > > public abstract String getNick();
> > > public abstract String getHeslo();
> > > public abstract void setZprava(String zprava);
> > >
> > > public void login(IRequestCycle cycle) throws SQLException
> > > {
> > > if (isValidLogin(getNick(), getHeslo())) {
> > > cycle.activate("Home.page");
> > >
> > > return;
> > > }
> > > setZprava("Spatne jmeno nebo heslo!!!");
> > > }
> > >
> > > private boolean isValidLogin(String nick, String heslo) throws
> > > SQLException { return true; //this is not important for this case
> > > }
> > > }
> > > ------------
> > >
> > > Login.html:
> > >
> > > <html jwcid="@Shell" title="Prihlaseni">
> > > <body>
> > > <span jwcid="@Conditional" condition="ognl:zprava">
> > > <font color=red>
> > > <span jwcid="@Insert" value="ognl:zprava">
> > > Error Message
> > > </span>
> > > </font>
> > > </span>
> > >
> > > <p>
> > >
> > > <form jwcid="@Form" listener="ognl:listeners.login">
> > >
> > > <table>
> > > <tr>
> > > <th>Jmeno Administratora: </th>
> > > <td>
> > > <input type="text" jwcid="@TextField" value="ognl:nick"
> > > size="30"/>
> > > </td>
> > > </tr>
> > >
> > > <tr>
> > > <th>Heslo: </th>
> > > <td>
> > > <input type="password" jwcid="@TextField"
> > > value="ognl:heslo" hidden="ognl:true" size="30"/>
> > > </td>
> > > </tr>
> > >
> > > <tr>
> > > <td><input type="submit" value="Login"/></td>
> > > </tr>
> > > </table>
> > > </form>
> > > </body>
> > > </html>
> > >
> > > Login.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">
> > > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> > >
> > > <page-specification class="org.cijoml.ui.pages.Login">
> > >
> > > <property-specification name="zprava" type="java.lang.String"/>
> > > <property-specification name="nick" type="java.lang.String"/>
> > > <property-specification name="heslo" type="java.lang.String"/>
> > >
> > > </page-specification>
> > >
> > > Thanks a lot for help!
> > >
> > > Michal
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to be redirected from login form to BasePage?
Posted by Daniel Jue <te...@gmail.com>.
I recommend the ebook "Enjoying Web Development with Tapestry". I am new to
Tapestry and without this book I would not have stayed with it.
The logon component you described is in the shopping cart example in chaper
4. BTW the first 4 chapters are free online.
On 8/24/06, hv @ Fashion Content <in...@fashioncontent.com> wrote:
>
> If you are starting fresh why not base your app on Tap4 ?
>
> "CIJOML" <ci...@volny.cz> skrev i en meddelelse
> news:200608241657.03199.cijoml@volny.cz...
> Hi Ron,
>
> thanks very much, It helped me a lot! I had to do more changes ;)
> <page name="Login" specification-path="Login.page"/>
> I forgot rename also page name! :(
>
> Thank you - probably a lot more questions will continue, while I am new to
> Tapestry kingdom :)
>
> Michal
>
> Dne ètvrtek 24 srpen 2006 16:19 Ron Piterman napsal(a):
> > its cycle.activate("Home");
> >
> > Cheers,Ron
> >
> > CIJOML wrote:
> > > Hi,
> > >
> > > I wrote little application which now I want secure.
> > > So I developped login form, but I am unable to be redirected to
> BasePage
> > > after successfull login.
> > >
> > > When I call such page directly in DP.application, it renders:
> > >
> > > <!DOCTYPE application PUBLIC
> > > "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> > > "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> > > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> > >
> > > <application name="DP"
> > > engine-class="org.apache.tapestry.engine.BaseEngine"> <description>DP
> > > Michal Semler</description>
> > > <page name="Home" specification-path="Home.page"/> <!-- uvodni
> > > stranka --> <library id="contrib"
> > > specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
> > > <library id="menu"
> > > specification-path="/org/krysalis/menu/component/Menu.library"/>
> > > </application>
> > >
> > > But when I change Home.page to Login.page, it returns errors:
> > >
> > > Login process goes OK, and then I don't know how to call from
> > > cycle.activate my Home.page:
> > >
> > > My Login.java
> > > -------------
> > > package org.cijoml.ui.pages;
> > >
> > > import java.sql.SQLException;
> > >
> > >
> > > import org.apache.tapestry.IRequestCycle;
> > > import org.apache.tapestry.IPage;
> > > import org.apache.tapestry.html.BasePage;
> > > import org.cijoml.utils.IBatisUtil;
> > > import org.cijoml.model.Administrator;
> > >
> > > import com.ibatis.sqlmap.client.SqlMapClient;
> > >
> > >
> > > public abstract class Login extends BasePage {
> > >
> > > public abstract String getNick();
> > > public abstract String getHeslo();
> > > public abstract void setZprava(String zprava);
> > >
> > > public void login(IRequestCycle cycle) throws SQLException
> > > {
> > > if (isValidLogin(getNick(), getHeslo())) {
> > > cycle.activate("Home.page");
> > >
> > > return;
> > > }
> > > setZprava("Spatne jmeno nebo heslo!!!");
> > > }
> > >
> > > private boolean isValidLogin(String nick, String heslo) throws
> > > SQLException { return true; //this is not important for this case
> > > }
> > > }
> > > ------------
> > >
> > > Login.html:
> > >
> > > <html jwcid="@Shell" title="Prihlaseni">
> > > <body>
> > > <span jwcid="@Conditional" condition="ognl:zprava">
> > > <font color=red>
> > > <span jwcid="@Insert" value="ognl:zprava">
> > > Error Message
> > > </span>
> > > </font>
> > > </span>
> > >
> > > <p>
> > >
> > > <form jwcid="@Form" listener="ognl:listeners.login">
> > >
> > > <table>
> > > <tr>
> > > <th>Jmeno Administratora: </th>
> > > <td>
> > > <input type="text" jwcid="@TextField"
> value="ognl:nick"
> > > size="30"/>
> > > </td>
> > > </tr>
> > >
> > > <tr>
> > > <th>Heslo: </th>
> > > <td>
> > > <input type="password" jwcid="@TextField"
> > > value="ognl:heslo" hidden="ognl:true" size="30"/>
> > > </td>
> > > </tr>
> > >
> > > <tr>
> > > <td><input type="submit" value="Login"/></td>
> > > </tr>
> > > </table>
> > > </form>
> > > </body>
> > > </html>
> > >
> > > Login.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">
> > > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> > >
> > > <page-specification class="org.cijoml.ui.pages.Login">
> > >
> > > <property-specification name="zprava" type="java.lang.String"/>
> > > <property-specification name="nick" type="java.lang.String"/>
> > > <property-specification name="heslo" type="java.lang.String"/>
> > >
> > > </page-specification>
> > >
> > > Thanks a lot for help!
> > >
> > > Michal
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: How to be redirected from login form to BasePage?
Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
If you are starting fresh why not base your app on Tap4 ?
"CIJOML" <ci...@volny.cz> skrev i en meddelelse
news:200608241657.03199.cijoml@volny.cz...
Hi Ron,
thanks very much, It helped me a lot! I had to do more changes ;)
<page name="Login" specification-path="Login.page"/>
I forgot rename also page name! :(
Thank you - probably a lot more questions will continue, while I am new to
Tapestry kingdom :)
Michal
Dne �tvrtek 24 srpen 2006 16:19 Ron Piterman napsal(a):
> its cycle.activate("Home");
>
> Cheers,Ron
>
> CIJOML wrote:
> > Hi,
> >
> > I wrote little application which now I want secure.
> > So I developped login form, but I am unable to be redirected to BasePage
> > after successfull login.
> >
> > When I call such page directly in DP.application, it renders:
> >
> > <!DOCTYPE application PUBLIC
> > "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> > "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> >
> > <application name="DP"
> > engine-class="org.apache.tapestry.engine.BaseEngine"> <description>DP
> > Michal Semler</description>
> > <page name="Home" specification-path="Home.page"/> <!-- uvodni
> > stranka --> <library id="contrib"
> > specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
> > <library id="menu"
> > specification-path="/org/krysalis/menu/component/Menu.library"/>
> > </application>
> >
> > But when I change Home.page to Login.page, it returns errors:
> >
> > Login process goes OK, and then I don't know how to call from
> > cycle.activate my Home.page:
> >
> > My Login.java
> > -------------
> > package org.cijoml.ui.pages;
> >
> > import java.sql.SQLException;
> >
> >
> > import org.apache.tapestry.IRequestCycle;
> > import org.apache.tapestry.IPage;
> > import org.apache.tapestry.html.BasePage;
> > import org.cijoml.utils.IBatisUtil;
> > import org.cijoml.model.Administrator;
> >
> > import com.ibatis.sqlmap.client.SqlMapClient;
> >
> >
> > public abstract class Login extends BasePage {
> >
> > public abstract String getNick();
> > public abstract String getHeslo();
> > public abstract void setZprava(String zprava);
> >
> > public void login(IRequestCycle cycle) throws SQLException
> > {
> > if (isValidLogin(getNick(), getHeslo())) {
> > cycle.activate("Home.page");
> >
> > return;
> > }
> > setZprava("Spatne jmeno nebo heslo!!!");
> > }
> >
> > private boolean isValidLogin(String nick, String heslo) throws
> > SQLException { return true; //this is not important for this case
> > }
> > }
> > ------------
> >
> > Login.html:
> >
> > <html jwcid="@Shell" title="Prihlaseni">
> > <body>
> > <span jwcid="@Conditional" condition="ognl:zprava">
> > <font color=red>
> > <span jwcid="@Insert" value="ognl:zprava">
> > Error Message
> > </span>
> > </font>
> > </span>
> >
> > <p>
> >
> > <form jwcid="@Form" listener="ognl:listeners.login">
> >
> > <table>
> > <tr>
> > <th>Jmeno Administratora: </th>
> > <td>
> > <input type="text" jwcid="@TextField" value="ognl:nick"
> > size="30"/>
> > </td>
> > </tr>
> >
> > <tr>
> > <th>Heslo: </th>
> > <td>
> > <input type="password" jwcid="@TextField"
> > value="ognl:heslo" hidden="ognl:true" size="30"/>
> > </td>
> > </tr>
> >
> > <tr>
> > <td><input type="submit" value="Login"/></td>
> > </tr>
> > </table>
> > </form>
> > </body>
> > </html>
> >
> > Login.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">
> > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> >
> > <page-specification class="org.cijoml.ui.pages.Login">
> >
> > <property-specification name="zprava" type="java.lang.String"/>
> > <property-specification name="nick" type="java.lang.String"/>
> > <property-specification name="heslo" type="java.lang.String"/>
> >
> > </page-specification>
> >
> > Thanks a lot for help!
> >
> > Michal
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to be redirected from login form to BasePage?
Posted by CIJOML <ci...@volny.cz>.
Hi Ron,
thanks very much, It helped me a lot! I had to do more changes ;)
<page name="Login" specification-path="Login.page"/>
I forgot rename also page name! :(
Thank you - probably a lot more questions will continue, while I am new to
Tapestry kingdom :)
Michal
Dne čtvrtek 24 srpen 2006 16:19 Ron Piterman napsal(a):
> its cycle.activate("Home");
>
> Cheers,Ron
>
> CIJOML wrote:
> > Hi,
> >
> > I wrote little application which now I want secure.
> > So I developped login form, but I am unable to be redirected to BasePage
> > after successfull login.
> >
> > When I call such page directly in DP.application, it renders:
> >
> > <!DOCTYPE application PUBLIC
> > "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> > "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> >
> > <application name="DP"
> > engine-class="org.apache.tapestry.engine.BaseEngine"> <description>DP
> > Michal Semler</description>
> > <page name="Home" specification-path="Home.page"/> <!-- uvodni
> > stranka --> <library id="contrib"
> > specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
> > <library id="menu"
> > specification-path="/org/krysalis/menu/component/Menu.library"/>
> > </application>
> >
> > But when I change Home.page to Login.page, it returns errors:
> >
> > Login process goes OK, and then I don't know how to call from
> > cycle.activate my Home.page:
> >
> > My Login.java
> > -------------
> > package org.cijoml.ui.pages;
> >
> > import java.sql.SQLException;
> >
> >
> > import org.apache.tapestry.IRequestCycle;
> > import org.apache.tapestry.IPage;
> > import org.apache.tapestry.html.BasePage;
> > import org.cijoml.utils.IBatisUtil;
> > import org.cijoml.model.Administrator;
> >
> > import com.ibatis.sqlmap.client.SqlMapClient;
> >
> >
> > public abstract class Login extends BasePage {
> >
> > public abstract String getNick();
> > public abstract String getHeslo();
> > public abstract void setZprava(String zprava);
> >
> > public void login(IRequestCycle cycle) throws SQLException
> > {
> > if (isValidLogin(getNick(), getHeslo())) {
> > cycle.activate("Home.page");
> >
> > return;
> > }
> > setZprava("Spatne jmeno nebo heslo!!!");
> > }
> >
> > private boolean isValidLogin(String nick, String heslo) throws
> > SQLException { return true; //this is not important for this case
> > }
> > }
> > ------------
> >
> > Login.html:
> >
> > <html jwcid="@Shell" title="Prihlaseni">
> > <body>
> > <span jwcid="@Conditional" condition="ognl:zprava">
> > <font color=red>
> > <span jwcid="@Insert" value="ognl:zprava">
> > Error Message
> > </span>
> > </font>
> > </span>
> >
> > <p>
> >
> > <form jwcid="@Form" listener="ognl:listeners.login">
> >
> > <table>
> > <tr>
> > <th>Jmeno Administratora: </th>
> > <td>
> > <input type="text" jwcid="@TextField" value="ognl:nick"
> > size="30"/>
> > </td>
> > </tr>
> >
> > <tr>
> > <th>Heslo: </th>
> > <td>
> > <input type="password" jwcid="@TextField"
> > value="ognl:heslo" hidden="ognl:true" size="30"/>
> > </td>
> > </tr>
> >
> > <tr>
> > <td><input type="submit" value="Login"/></td>
> > </tr>
> > </table>
> > </form>
> > </body>
> > </html>
> >
> > Login.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">
> > <!-- generated by Spindle, http://spindle.sourceforge.net -->
> >
> > <page-specification class="org.cijoml.ui.pages.Login">
> >
> > <property-specification name="zprava" type="java.lang.String"/>
> > <property-specification name="nick" type="java.lang.String"/>
> > <property-specification name="heslo" type="java.lang.String"/>
> >
> > </page-specification>
> >
> > Thanks a lot for help!
> >
> > Michal
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to be redirected from login form to BasePage?
Posted by Ron Piterman <rp...@gmx.net>.
its cycle.activate("Home");
Cheers,Ron
CIJOML wrote:
> Hi,
>
> I wrote little application which now I want secure.
> So I developped login form, but I am unable to be redirected to BasePage after
> successfull login.
>
> When I call such page directly in DP.application, it renders:
>
> <!DOCTYPE application PUBLIC
> "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> <!-- generated by Spindle, http://spindle.sourceforge.net -->
>
> <application name="DP" engine-class="org.apache.tapestry.engine.BaseEngine">
> <description>DP Michal Semler</description>
> <page name="Home" specification-path="Home.page"/> <!-- uvodni stranka -->
> <library id="contrib"
> specification-path="/org/apache/tapestry/contrib/Contrib.library"/>
> <library id="menu"
> specification-path="/org/krysalis/menu/component/Menu.library"/>
> </application>
>
> But when I change Home.page to Login.page, it returns errors:
>
> Login process goes OK, and then I don't know how to call from cycle.activate
> my Home.page:
>
> My Login.java
> -------------
> package org.cijoml.ui.pages;
>
> import java.sql.SQLException;
>
>
> import org.apache.tapestry.IRequestCycle;
> import org.apache.tapestry.IPage;
> import org.apache.tapestry.html.BasePage;
> import org.cijoml.utils.IBatisUtil;
> import org.cijoml.model.Administrator;
>
> import com.ibatis.sqlmap.client.SqlMapClient;
>
>
> public abstract class Login extends BasePage {
>
> public abstract String getNick();
> public abstract String getHeslo();
> public abstract void setZprava(String zprava);
>
> public void login(IRequestCycle cycle) throws SQLException
> {
> if (isValidLogin(getNick(), getHeslo())) {
> cycle.activate("Home.page");
>
> return;
> }
> setZprava("Spatne jmeno nebo heslo!!!");
> }
>
> private boolean isValidLogin(String nick, String heslo) throws SQLException {
> return true; //this is not important for this case
> }
> }
> ------------
>
> Login.html:
>
> <html jwcid="@Shell" title="Prihlaseni">
> <body>
> <span jwcid="@Conditional" condition="ognl:zprava">
> <font color=red>
> <span jwcid="@Insert" value="ognl:zprava">
> Error Message
> </span>
> </font>
> </span>
>
> <p>
>
> <form jwcid="@Form" listener="ognl:listeners.login">
>
> <table>
> <tr>
> <th>Jmeno Administratora: </th>
> <td>
> <input type="text" jwcid="@TextField" value="ognl:nick"
> size="30"/>
> </td>
> </tr>
>
> <tr>
> <th>Heslo: </th>
> <td>
> <input type="password" jwcid="@TextField" value="ognl:heslo"
> hidden="ognl:true" size="30"/>
> </td>
> </tr>
>
> <tr>
> <td><input type="submit" value="Login"/></td>
> </tr>
> </table>
> </form>
> </body>
> </html>
>
> Login.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">
> <!-- generated by Spindle, http://spindle.sourceforge.net -->
>
> <page-specification class="org.cijoml.ui.pages.Login">
>
> <property-specification name="zprava" type="java.lang.String"/>
> <property-specification name="nick" type="java.lang.String"/>
> <property-specification name="heslo" type="java.lang.String"/>
>
> </page-specification>
>
> Thanks a lot for help!
>
> Michal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org