url param binding to actiobean object

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

url param binding to actiobean object

ted_smith2010
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

Ben Gunter
  1. Are you sure everything is spelled correctly (getter name, link parameter, etc.)?
  2. Is the Location class public?
  3. Is there a public no-arg constructor for Location?
  4. Is setId(Integer) public?
  5. Are you using @StrictBinding on your  class? If so, do you have a @Validate for your id property (nested on the location field)?
If you can answer yes to all of those, then you should set the log level to debug and try the request again to see what's going on. That almost always provides the answer.

-Ben

On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

Mike McNally-3
In reply to this post by ted_smith2010

The parameter name should be "location" if you're using the auto loader thingy.  The loader knows how to get the key property.

On Feb 11, 2012 10:00 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

Adam Stokar
In reply to this post by ted_smith2010
What is your URLBinding for the action bean?  It should look something like this:

@UrlBinding(value="/actionName/{location.id}")

and URL would be <a href="/context/actionName/40

On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

ted_smith2010
I am using DynamicMapFilter.
I am using conventional url   /context/location/updateinput?location.id=40
@UrlBinding("/location")
LocationBean{
  Location location

You get the idea it is CRUD on location object.
I was able to create with the above using /context/location/createinput?

Does auto binding require the form of /location/{location}/{id}
that would be too bad.




From: "Adam Stokar" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 11:31:28 AM
Subject: Re: [Stripes-users] url param binding to actiobean object

What is your URLBinding for the action bean?  It should look something like this:

@UrlBinding(value="/actionName/{location.id}")

and URL would be <a href="/context/actionName/40

On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

Mike McNally-3
If you're using auto-binding, the HTTP parameter name (i.e., the input
field "name" attribute) must match the name of the bean property. Try
with just "location" as the parameter name. Its value should be the
primary key value; that is, the value you're currently using as the
value of "location.id".


On Sat, Feb 11, 2012 at 2:14 PM,  <[hidden email]> wrote:

> I am using DynamicMapFilter.
> I am using conventional url   /context/location/updateinput?location.id=40
> @UrlBinding("/location")
> LocationBean{
>   Location location
>
> You get the idea it is CRUD on location object.
> I was able to create with the above using /context/location/createinput?
>
> Does auto binding require the form of /location/{location}/{id}
> that would be too bad.
>
>
>
> ________________________________
> From: "Adam Stokar" <[hidden email]>
> To: "Stripes Users List" <[hidden email]>
> Sent: Saturday, February 11, 2012 11:31:28 AM
> Subject: Re: [Stripes-users] url param binding to actiobean object
>
>
> What is your URLBinding for the action bean?  It should look something like
> this:
>
> @UrlBinding(value="/actionName/{location.id}")
>
> and URL would be <a href="/context/actionName/40
>
> On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
>>
>> Hi:
>>
>> I have a URL like
>> <a href="/context/actionName?location.id=40"
>> and my action bean class like
>> class AB {
>>   protected Location location
>>   public getLocation
>>   public setLocation......
>> }
>> class Location{
>>   private id;
>>   public getId
>>   public setId(Integer id)...
>> }
>> I would expect clicking the link would auto create the location object and
>> set the id to be "40"
>> but my test shows the location object remains to be null when the handler
>> is called.
>>
>> But similar  binding works if I use post inside a form.
>>
>> Thanks in advance.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Virtualization & Cloud Management Using Capacity Planning
>> Cloud computing makes use of virtualization - but cloud computing
>> also focuses on allowing computing to be delivered as a service.
>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> _______________________________________________
>> Stripes-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



--
Turtle, turtle, on the ground,
Pink and shiny, turn around.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

ted_smith2010
In reply to this post by Ben Gunter
Most are yes. It worked when doing posting (create location) and all the binding
specified in the form to posting worked fine.
but when I do GET with location.id=40, it is not doing binding. no log info about this even with
debug level. so somehow some steps were bypassed


From: "Ben Gunter" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 11:16:59 AM
Subject: Re: [Stripes-users] url param binding to actiobean object

  1. Are you sure everything is spelled correctly (getter name, link parameter, etc.)?
  2. Is the Location class public?
  3. Is there a public no-arg constructor for Location?
  4. Is setId(Integer) public?
  5. Are you using @StrictBinding on your  class? If so, do you have a @Validate for your id property (nested on the location field)?
If you can answer yes to all of those, then you should set the log level to debug and try the request again to see what's going on. That almost always provides the answer.

-Ben

On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

ted_smith2010
I just did a test doing POST, many log messages about bindings of like location.address
so my logging is set right
but when to GET location.id=40,  no single line of binding related. it go straight to
handler.


From: "ted smith2010" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 3:27:36 PM
Subject: Re: [Stripes-users] url param binding to actiobean object

Most are yes. It worked when doing posting (create location) and all the binding
specified in the form to posting worked fine.
but when I do GET with location.id=40, it is not doing binding. no log info about this even with
debug level. so somehow some steps were bypassed


From: "Ben Gunter" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 11:16:59 AM
Subject: Re: [Stripes-users] url param binding to actiobean object

  1. Are you sure everything is spelled correctly (getter name, link parameter, etc.)?
  2. Is the Location class public?
  3. Is there a public no-arg constructor for Location?
  4. Is setId(Integer) public?
  5. Are you using @StrictBinding on your  class? If so, do you have a @Validate for your id property (nested on the location field)?
If you can answer yes to all of those, then you should set the log level to debug and try the request again to see what's going on. That almost always provides the answer.

-Ben

On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: url param binding to actiobean object

ted_smith2010
I found the issue. my stupidity.  a non-printable character somehow was embedded in  the url.
Everything works great now.

Thanks for everyone helping on this.


From: "ted smith2010" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 3:32:39 PM
Subject: Re: [Stripes-users] url param binding to actiobean object

I just did a test doing POST, many log messages about bindings of like location.address
so my logging is set right
but when to GET location.id=40,  no single line of binding related. it go straight to
handler.


From: "ted smith2010" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 3:27:36 PM
Subject: Re: [Stripes-users] url param binding to actiobean object

Most are yes. It worked when doing posting (create location) and all the binding
specified in the form to posting worked fine.
but when I do GET with location.id=40, it is not doing binding. no log info about this even with
debug level. so somehow some steps were bypassed


From: "Ben Gunter" <[hidden email]>
To: "Stripes Users List" <[hidden email]>
Sent: Saturday, February 11, 2012 11:16:59 AM
Subject: Re: [Stripes-users] url param binding to actiobean object

  1. Are you sure everything is spelled correctly (getter name, link parameter, etc.)?
  2. Is the Location class public?
  3. Is there a public no-arg constructor for Location?
  4. Is setId(Integer) public?
  5. Are you using @StrictBinding on your  class? If so, do you have a @Validate for your id property (nested on the location field)?
If you can answer yes to all of those, then you should set the log level to debug and try the request again to see what's going on. That almost always provides the answer.

-Ben

On Sat, Feb 11, 2012 at 10:58 AM, <[hidden email]> wrote:
Hi:

I have a URL like
<a href="/context/actionName?location.id=40"
and my action bean class like
class AB {
  protected Location location
  public getLocation
  public setLocation......
}
class Location{
  private id;
  public getId
  public setId(Integer id)...
}
I would expect clicking the link would auto create the location object and set the id to be "40"
but my test shows the location object remains to be null when the handler is called.

But similar  binding works if I use post inside a form.

Thanks in advance.








------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users