You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Jiujing Gu <jg...@met.fsu.edu> on 2010/03/25 16:58:14 UTC

(/TestClick/$myLink.href) is not available

Hello,

I'm following the user guide.  When I tried the control listener type 1
example in Chapter 1.2, I got an error message. Please let me know
what did I do wrong.

Thanks,
Jiujing
------------------------

HTTP Status 404 - /TestClick/$myLink.href

________________________________________________________________________

type Status report

message /TestClick/$myLink.href

description The requested resource (/TestClick/$myLink.href) is not
available.


________________________________________________________________________
Apache Tomcat/5.5.26


Re: (/TestClick/$myLink.href) is not available

Posted by "Gilberto C. Andrade" <gi...@gmail.com>.
Yes, just for now - until we know more about bindable, rs rs - use public
fields.
My code:
package com.mycompany.controlistener;

import org.apache.click.control.ActionLink;
import org.apache.click.Page;

public class ControlListenerType1Page extends Page {

   /* Set the listener to this object's "onLinkClick" method. */
   public ActionLink myLink = new ActionLink(this,"onLinkClick");

   public String msg;

   // ------------------------------------------------- Event Handlers

   /**
    * Handle the ActionLink control click event.
    */
   public boolean onLinkClick() {
       msg = "ControlListenerPage#" + hashCode()
           + " object method <tt>onLinkClick()</tt> invoked.";

       return true;
   }
}



On Thu, Mar 25, 2010 at 3:37 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:

> If I read you correctly, you are suggesting me to get rid of the
> three import statements.  But, I added them in because without them, it
> would not compile.
>
> Jiujing
>
> On Thu, 2010-03-25 at 15:18 -0300, Gilberto C. Andrade wrote:
> > See my comments ..
> >
> > On Thu, Mar 25, 2010 at 2:45 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:
> >         I copied everything from the user guide.
> >
> >         Here is the ControlListenerType1.htm
> >
> >         <html>
> >          <head>
> >            <link type="text/css" rel="stylesheet"
> >         href="style.css"></link>
> >          </head>
> >          <body>
> >
> >          Click myLink control <a href="$myLink.href">here</a>.
> >
> >          #if ($msg)
> >            <div id="msgDiv"> $msg </div>
> >          #end
> >
> >          </body>
> >         </html>
> >         ----------------
> >         Here is click.xml
> >
> >         <?xml version="1.0" encoding="UTF-8"?>
> >         <click-app>
> >
> >          <pages package="quickstart.page"/>
> >
> >          <mode value="debug"/>
> >
> >         </click-app>
> >         --------------------------------
> >
> >         Here is the ControlListenerType1Page.java under
> >         WEB-INF/classes/quickstart/page
> >
> >         package quickstart.page;
> >
> >         import org.apache.click.control.ActionLink;
> >         import org.apache.click.Page;
> >         import org.apache.click.util.Bindable;
> >
> > The problem occurs while using the bindable interface
> > So, remove this dependence and the annotations, like:
> > [code]
> > public class ControlListenerType1Page extends Page {
> >
> >    /* Set the listener to this object's "onLinkClick" method. */
> >    public ActionLink myLink = new ActionLink(this,"onLinkClick");
> >
> >    public String msg;
> > [/code]
> >
> > I've have some problems with this interface. I'm only using the old
> > method until I get used it.
> >
> > Gilberto
> >
> >
> >
> >         public class ControlListenerType1Page extends Page {
> >
> >            /* Set the listener to this object's "onLinkClick" method.
> >         */
> >            @Bindable protected ActionLink myLink = new
> >         ActionLink(this,
> >         "onLinkClick");
> >
> >            @Bindable protected String msg;
> >
> >            // ------------------------------------------------- Event
> >         Handlers
> >
> >            /**
> >             * Handle the ActionLink control click event.
> >             */
> >            public boolean onLinkClick() {
> >                msg = "ControlListenerPage#" + hashCode()
> >                    + " object method <tt>onLinkClick()</tt> invoked.";
> >
> >                return true;
> >
> >            }
> >
> >         }
> >
> >         On Thu, 2010-03-25 at 14:35 -0300, Gilberto C. Andrade wrote:
> >         > Can you show us  the control-listener-type1.htm and
> >         click.xml files?
> >         > So, control-listener-type1.htm file will be mapped to
> >         > ControlListenerType1Page.java.
> >         >
> >         > Regards,
> >         >
> >         > Gilberto
> >         >
> >         > On Thu, Mar 25, 2010 at 12:58 PM, Jiujing Gu
> >         <jg...@met.fsu.edu> wrote:
> >         >         Hello,
> >         >
> >         >         I'm following the user guide.  When I tried the
> >         control
> >         >         listener type 1
> >         >         example in Chapter 1.2, I got an error message.
> >         Please let me
> >         >         know
> >         >         what did I do wrong.
> >         >
> >         >         Thanks,
> >         >         Jiujing
> >         >         ------------------------
> >         >
> >         >         HTTP Status 404 - /TestClick/$myLink.href
> >         >
> >         >
> >
> ________________________________________________________________________
> >         >
> >         >         type Status report
> >         >
> >         >         message /TestClick/$myLink.href
> >         >
> >         >         description The requested resource
> >         (/TestClick/$myLink.href)
> >         >         is not
> >         >         available.
> >         >
> >         >
> >         >
> >
> ________________________________________________________________________
> >         >         Apache Tomcat/5.5.26
> >         >
> >         >
> >
> >
> >
>
>

Re: (/TestClick/$myLink.href) is not available

Posted by Jiujing Gu <jg...@met.fsu.edu>.
If I read you correctly, you are suggesting me to get rid of the
three import statements.  But, I added them in because without them, it
would not compile.

Jiujing

On Thu, 2010-03-25 at 15:18 -0300, Gilberto C. Andrade wrote:
> See my comments ..
> 
> On Thu, Mar 25, 2010 at 2:45 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:
>         I copied everything from the user guide.
>         
>         Here is the ControlListenerType1.htm
>         
>         <html>
>          <head>
>            <link type="text/css" rel="stylesheet"
>         href="style.css"></link>
>          </head>
>          <body>
>         
>          Click myLink control <a href="$myLink.href">here</a>.
>         
>          #if ($msg)
>            <div id="msgDiv"> $msg </div>
>          #end
>         
>          </body>
>         </html>
>         ----------------
>         Here is click.xml
>         
>         <?xml version="1.0" encoding="UTF-8"?>
>         <click-app>
>         
>          <pages package="quickstart.page"/>
>         
>          <mode value="debug"/>
>         
>         </click-app>
>         --------------------------------
>         
>         Here is the ControlListenerType1Page.java under
>         WEB-INF/classes/quickstart/page
>         
>         package quickstart.page;
>         
>         import org.apache.click.control.ActionLink;
>         import org.apache.click.Page;
>         import org.apache.click.util.Bindable;
>  
> The problem occurs while using the bindable interface
> So, remove this dependence and the annotations, like:
> [code]
> public class ControlListenerType1Page extends Page {
> 
>    /* Set the listener to this object's "onLinkClick" method. */
>    public ActionLink myLink = new ActionLink(this,"onLinkClick");
> 
>    public String msg;
> [/code]
> 
> I've have some problems with this interface. I'm only using the old
> method until I get used it.
> 
> Gilberto
>  
> 
>         
>         public class ControlListenerType1Page extends Page {
>         
>            /* Set the listener to this object's "onLinkClick" method.
>         */
>            @Bindable protected ActionLink myLink = new
>         ActionLink(this,
>         "onLinkClick");
>         
>            @Bindable protected String msg;
>         
>            // ------------------------------------------------- Event
>         Handlers
>         
>            /**
>             * Handle the ActionLink control click event.
>             */
>            public boolean onLinkClick() {
>                msg = "ControlListenerPage#" + hashCode()
>                    + " object method <tt>onLinkClick()</tt> invoked.";
>         
>                return true;
>         
>            }
>         
>         }
>         
>         On Thu, 2010-03-25 at 14:35 -0300, Gilberto C. Andrade wrote:
>         > Can you show us  the control-listener-type1.htm and
>         click.xml files?
>         > So, control-listener-type1.htm file will be mapped to
>         > ControlListenerType1Page.java.
>         >
>         > Regards,
>         >
>         > Gilberto
>         >
>         > On Thu, Mar 25, 2010 at 12:58 PM, Jiujing Gu
>         <jg...@met.fsu.edu> wrote:
>         >         Hello,
>         >
>         >         I'm following the user guide.  When I tried the
>         control
>         >         listener type 1
>         >         example in Chapter 1.2, I got an error message.
>         Please let me
>         >         know
>         >         what did I do wrong.
>         >
>         >         Thanks,
>         >         Jiujing
>         >         ------------------------
>         >
>         >         HTTP Status 404 - /TestClick/$myLink.href
>         >
>         >
>         ________________________________________________________________________
>         >
>         >         type Status report
>         >
>         >         message /TestClick/$myLink.href
>         >
>         >         description The requested resource
>         (/TestClick/$myLink.href)
>         >         is not
>         >         available.
>         >
>         >
>         >
>         ________________________________________________________________________
>         >         Apache Tomcat/5.5.26
>         >
>         >
>         
>         
> 


Re: (/TestClick/$myLink.href) is not available

Posted by "Gilberto C. Andrade" <gi...@gmail.com>.
See my comments ..

On Thu, Mar 25, 2010 at 2:45 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:

> I copied everything from the user guide.
>
> Here is the ControlListenerType1.htm
>
> <html>
>  <head>
>    <link type="text/css" rel="stylesheet" href="style.css"></link>
>  </head>
>  <body>
>
>  Click myLink control <a href="$myLink.href">here</a>.
>
>  #if ($msg)
>    <div id="msgDiv"> $msg </div>
>  #end
>
>  </body>
> </html>
> ----------------
> Here is click.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <click-app>
>
>  <pages package="quickstart.page"/>
>
>  <mode value="debug"/>
>
> </click-app>
> --------------------------------
>
> Here is the ControlListenerType1Page.java under
> WEB-INF/classes/quickstart/page
>
> package quickstart.page;
>
> import org.apache.click.control.ActionLink;
> import org.apache.click.Page;
>
import org.apache.click.util.Bindable;
>

The problem occurs while using the bindable interface
So, remove this dependence and the annotations, like:
[code]
public class ControlListenerType1Page extends Page {

   /* Set the listener to this object's "onLinkClick" method. */
   public ActionLink myLink = new ActionLink(this,"onLinkClick");

   public String msg;
[/code]

I've have some problems with this interface. I'm only using the old method
until I get used it.

Gilberto


>
> public class ControlListenerType1Page extends Page {
>
>    /* Set the listener to this object's "onLinkClick" method. */
>    @Bindable protected ActionLink myLink = new ActionLink(this,
> "onLinkClick");
>
>    @Bindable protected String msg;
>
>    // ------------------------------------------------- Event Handlers
>
>    /**
>     * Handle the ActionLink control click event.
>     */
>    public boolean onLinkClick() {
>        msg = "ControlListenerPage#" + hashCode()
>            + " object method <tt>onLinkClick()</tt> invoked.";
>
>        return true;
>     }
>
> }
>
> On Thu, 2010-03-25 at 14:35 -0300, Gilberto C. Andrade wrote:
> > Can you show us  the control-listener-type1.htm and click.xml files?
> > So, control-listener-type1.htm file will be mapped to
> > ControlListenerType1Page.java.
> >
> > Regards,
> >
> > Gilberto
> >
> > On Thu, Mar 25, 2010 at 12:58 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:
> >         Hello,
> >
> >         I'm following the user guide.  When I tried the control
> >         listener type 1
> >         example in Chapter 1.2, I got an error message. Please let me
> >         know
> >         what did I do wrong.
> >
> >         Thanks,
> >         Jiujing
> >         ------------------------
> >
> >         HTTP Status 404 - /TestClick/$myLink.href
> >
> >
> ________________________________________________________________________
> >
> >         type Status report
> >
> >         message /TestClick/$myLink.href
> >
> >         description The requested resource (/TestClick/$myLink.href)
> >         is not
> >         available.
> >
> >
> >
> ________________________________________________________________________
> >         Apache Tomcat/5.5.26
> >
> >
>
>

Re: (/TestClick/$myLink.href) is not available

Posted by Jiujing Gu <jg...@met.fsu.edu>.
I copied everything from the user guide.

Here is the ControlListenerType1.htm 

<html>
  <head>
    <link type="text/css" rel="stylesheet" href="style.css"></link>
  </head>
  <body>

  Click myLink control <a href="$myLink.href">here</a>.

  #if ($msg)
    <div id="msgDiv"> $msg </div>
  #end

  </body>
</html>
----------------
Here is click.xml

<?xml version="1.0" encoding="UTF-8"?> 
<click-app> 

  <pages package="quickstart.page"/>

  <mode value="debug"/>

</click-app>
--------------------------------

Here is the ControlListenerType1Page.java under
WEB-INF/classes/quickstart/page

package quickstart.page;

import org.apache.click.control.ActionLink;
import org.apache.click.Page;
import org.apache.click.util.Bindable;

public class ControlListenerType1Page extends Page {

    /* Set the listener to this object's "onLinkClick" method. */
    @Bindable protected ActionLink myLink = new ActionLink(this,
"onLinkClick");

    @Bindable protected String msg;

    // ------------------------------------------------- Event Handlers

    /**
     * Handle the ActionLink control click event.
     */
    public boolean onLinkClick() {
        msg = "ControlListenerPage#" + hashCode()
            + " object method <tt>onLinkClick()</tt> invoked.";

        return true;
    }

}

On Thu, 2010-03-25 at 14:35 -0300, Gilberto C. Andrade wrote:
> Can you show us  the control-listener-type1.htm and click.xml files?
> So, control-listener-type1.htm file will be mapped to
> ControlListenerType1Page.java.
> 
> Regards,
> 
> Gilberto
> 
> On Thu, Mar 25, 2010 at 12:58 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:
>         Hello,
>         
>         I'm following the user guide.  When I tried the control
>         listener type 1
>         example in Chapter 1.2, I got an error message. Please let me
>         know
>         what did I do wrong.
>         
>         Thanks,
>         Jiujing
>         ------------------------
>         
>         HTTP Status 404 - /TestClick/$myLink.href
>         
>         ________________________________________________________________________
>         
>         type Status report
>         
>         message /TestClick/$myLink.href
>         
>         description The requested resource (/TestClick/$myLink.href)
>         is not
>         available.
>         
>         
>         ________________________________________________________________________
>         Apache Tomcat/5.5.26
>         
> 


Re: (/TestClick/$myLink.href) is not available

Posted by "Gilberto C. Andrade" <gi...@gmail.com>.
Can you show us  the control-listener-type1.htm and click.xml files?
So, control-listener-type1.htm file will be mapped to
ControlListenerType1Page.java.

Regards,

Gilberto

On Thu, Mar 25, 2010 at 12:58 PM, Jiujing Gu <jg...@met.fsu.edu> wrote:

> Hello,
>
> I'm following the user guide.  When I tried the control listener type 1
> example in Chapter 1.2, I got an error message. Please let me know
> what did I do wrong.
>
> Thanks,
> Jiujing
> ------------------------
>
> HTTP Status 404 - /TestClick/$myLink.href
>
> ________________________________________________________________________
>
> type Status report
>
> message /TestClick/$myLink.href
>
> description The requested resource (/TestClick/$myLink.href) is not
> available.
>
>
> ________________________________________________________________________
> Apache Tomcat/5.5.26
>
>

Re: (/TestClick/$myLink.href) is not available

Posted by jg...@met.fsu.edu.
It works now. Thank you very much!

Jiujing
--------------
> Hi Jiujing,
>
>
> On 26/03/2010 02:58 AM, Jiujing Gu wrote:
>> Hello,
>>
>> I'm following the user guide.  When I tried the control listener type 1
>> example in Chapter 1.2, I got an error message. Please let me know
>> what did I do wrong.
>
>
> Older versions of Click used public fields for autobinding. Click 2.1.0
> introduced the @Bindable
> annotation but for backwards compatibility only binds public fields by
> default. To use @Bindable you
> need to configure Click's click.xml as follows:
>
> <click-app>
>    <pages package="examples.page" autobinding="annotation"/>
> </click-app
>
> I'll update the user-guide to reflect this.
>
> kind regards
>
> bob
>
>



Re: Why do I have to use import to compile?

Posted by Andrei Ionescu <ai...@yahoo.com>.
 >> Perhaps there was a misunderstanding. If you use the Bindable 
annotation you need to import it like so:
> I see.  You didn't have it in the user guide or the quick start guide.
> That made me wondering.
Because it's in every Java book - not something Click specific:

Every class, inteface, enumeration, annotation that you might want to 
use in Java needs to be imported with an import statement!

A smart IDE like IntelliJ would have proposed to add that import 
automatically.

Andrei.



Re: Why do I have to use import to compile?

Posted by Jiujing Gu <jg...@met.fsu.edu>.
I see.  You didn't have it in the user guide or the quick start guide.
That made me wondering.

Thanks,
Jiujing
--------------------
On Sat, 2010-03-27 at 00:10 +1100, Bob Schellink wrote:
> Perhaps there was a misunderstanding. If you use the Bindable annotation you need to import it like so:
> 
>    import org.apache.click.util.Bindable;
> 
> kind regards
> 
> bob
> 
> 
> On 26/03/2010 11:37 PM, Jiujing Gu wrote:
> > Hello,
> >
> > This is related to my previous question.  I don't understand why do I
> > have to have those import statements to get the java code compiled.
> > Other people doesn't seem to need it.  Does  this mean there is
> > something wrong in my setup?
> >
> > I installed click, tomcat&  apache under /usr/local.  I'm running the
> > tests in my account under /home.
> >
> > Jiujing
> >
> 


Re: Why do I have to use import to compile?

Posted by Bob Schellink <sa...@gmail.com>.
Perhaps there was a misunderstanding. If you use the Bindable annotation you need to import it like so:

   import org.apache.click.util.Bindable;

kind regards

bob


On 26/03/2010 11:37 PM, Jiujing Gu wrote:
> Hello,
>
> This is related to my previous question.  I don't understand why do I
> have to have those import statements to get the java code compiled.
> Other people doesn't seem to need it.  Does  this mean there is
> something wrong in my setup?
>
> I installed click, tomcat&  apache under /usr/local.  I'm running the
> tests in my account under /home.
>
> Jiujing
>


Why do I have to use import to compile?

Posted by Jiujing Gu <jg...@met.fsu.edu>.
Hello,

This is related to my previous question.  I don't understand why do I 
have to have those import statements to get the java code compiled.
Other people doesn't seem to need it.  Does  this mean there is 
something wrong in my setup?

I installed click, tomcat & apache under /usr/local.  I'm running the
tests in my account under /home.

Jiujing



Re: (/TestClick/$myLink.href) is not available

Posted by Bob Schellink <sa...@gmail.com>.
Hi Jiujing,


On 26/03/2010 02:58 AM, Jiujing Gu wrote:
> Hello,
>
> I'm following the user guide.  When I tried the control listener type 1
> example in Chapter 1.2, I got an error message. Please let me know
> what did I do wrong.


Older versions of Click used public fields for autobinding. Click 2.1.0 introduced the @Bindable 
annotation but for backwards compatibility only binds public fields by default. To use @Bindable you 
need to configure Click's click.xml as follows:

<click-app>
   <pages package="examples.page" autobinding="annotation"/>
</click-app

I'll update the user-guide to reflect this.

kind regards

bob