org.springframework.webflow.samples.booking
Class PreferencesController

java.lang.Object
  extended by org.springframework.webflow.samples.booking.PreferencesController

@Controller
public class PreferencesController
extends Object


Constructor Summary
PreferencesController()
          This empty constructor is needed in order for the Spring Security annotations to work as expected
PreferencesController(TravelService travelService)
           
 
Method Summary
 String addPreference(Preference preference, Principal currentUser)
           
 String deletePreference(Long id, Principal currentUser)
           
 String getPreference(String username, Long id)
           
 String getPreferences(String username, org.springframework.ui.Model model)
           
 String savePreference(Preference preference, Principal currentUser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesController

public PreferencesController()
This empty constructor is needed in order for the Spring Security annotations to work as expected


PreferencesController

public PreferencesController(TravelService travelService)
Method Detail

getPreferences

@PreAuthorize(value="!isAnonymous() AND (#username == principal.username OR hasRole(\'ROLE_ADMIN\'))")
@RequestMapping(value="/{username}/preferences",
                method=GET)
public String getPreferences(@PathVariable
                                                         String username,
                                                         org.springframework.ui.Model model)

getPreference

@PreAuthorize(value="!isAnonymous() AND (#username == principal.username OR hasRole(\'ROLE_ADMIN\'))")
@RequestMapping(value="/{username}/preferences/{id}",
                method=GET)
public String getPreference(@PathVariable
                                                        String username,
                                                        @PathVariable
                                                        Long id)

addPreference

@PreAuthorize(value="!isAnonymous() AND (#username == principal.username OR hasRole(\'ROLE_ADMIN\'))")
@RequestMapping(value="/{username}/preferences/new",
                method=POST)
public String addPreference(Preference preference,
                                                        Principal currentUser)

savePreference

@PreAuthorize(value="!isAnonymous() AND (#username == principal.username OR hasRole(\'ROLE_ADMIN\'))")
@RequestMapping(value="/{username}/preferences/{id}",
                method=PUT)
public String savePreference(Preference preference,
                                                         Principal currentUser)

deletePreference

@PreAuthorize(value="!isAnonymous() AND (#username == principal.username OR hasRole(\'ROLE_ADMIN\'))")
@RequestMapping(value="/{username}/preferences/{id}",
                method=DELETE)
public String deletePreference(@PathVariable(value="id")
                                                           Long id,
                                                           Principal currentUser)


Copyright © 2009 SpringSource, Inc. All Rights Reserved.