You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by cablepuff <ca...@gmail.com> on 2010/10/20 23:11:02 UTC

tapestry tynamo forum login question.

Hi i have a few question. how do i set up jdbc relam is doing this k? 

public class AppModule {
	@Inject
	private static DataSource dataSource;
	private static JdbcRealm realm;
	
	private static final String AUTHENTICATION_QUERY = "select PASSWORD from
USER_ROLES_VIEW where USER_NAME  = ?";
	private static final String USER_ROLES_QUERY = "select ROLE_NAME from
USER_ROLES_VIEW where USER_NAME = ?";
	
    public static void bind(ServiceBinder binder) {
    	binder.bind(ReplyDao.class, ReplyDaoJdbcImpl.class);
    	binder.bind(ReviewDao.class, ReviewDaoJdbcImpl.class);
    	binder.bind(ImageDao.class, ImageDaoJdbcImpl.class);
    	binder.bind(ContentWriteService.class, ContentWriteServiceImpl.class);
    	binder.bind(ContentReadService.class, ContentReadServiceImpl.class);
    }
    
    public static void contributeWebSecurityManager(Configuration<Realm>
configuration) {
		realm = new JdbcRealm();
		realm.setDataSource(dataSource);
		realm.setAuthenticationQuery(AUTHENTICATION_QUERY);
		realm.setUserRolesQuery(USER_ROLES_QUERY);
		realm.setPermissionsLookupEnabled(true);
		configuration.add(realm);
	}
}

2nd for the login page what happen if i want to override the design and
force it to go to https how do i do that? 


thanks, 

Chun Ping Wang. 
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/tapestry-tynamo-forum-login-question-tp3229411p3229411.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org