• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Portlet 2.0 annotations help

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am working on weblogic portal code.
I just started. I am having difficulty understanding these 3 annotations below and cannot find some good source / book over the internet.

Could some help explain what these annotations are doing in my code and where can i get some more useful information / books.

@ResourceMapping(value = "getPaymentInfo")
@ModelAttribute("user")
@ActionMapping(params = "action=associateAccount")

Thanks
Neo







 
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Neo,

You can refer to some of the articles posted at DZone to get a better understanding of these annotations. Portlets in Action has 2 chapters (7 and 8) dedicated to using Spring Portlet MVC, which can help you get a more detailed understanding of these annotations.

@ResourceMapping - identifies a method responsible for serving resources
@ActionMapping - identifies a method responsible for processing action requests
@ModelAttribue - specifies the name of the model attribute, which you might represent reference data or data that needs to be stored in handler's conversational session

regards
ashish
 
Leonard Damien
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks for the reply Ashish.
I will take help from where you have pointed to.

Could someone tell me the primary difference between these 2 annotations.
I mean, couldn't an actionmapping be used to serve resources.

Thanks

@ResourceMapping - identifies a method responsible for serving resources
@ActionMapping - identifies a method responsible for processing action requests
 
Ashish Sarin
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To understand the difference you need to look at the resource serving and action processing phases in portlet lifecycle. The resource serving phase is meant for serving resources (like downloading files) and handling AJAX requests.
 
Ashish Sarin
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have posted figures on my blog which show action, render and resource lifecycle phases of portlets. You can look here: http://portlets-in-action.blogspot.com/

Hope this helps.

regards
ashish
 
reply
    Bookmark Topic Watch Topic
  • New Topic