我对此非常陌生,我认为我不应该混淆客户端和服务器端之类的所有内容......但我想不出任何其他选择。
我想要的是接受下拉选择的值并使用<div class="control-group" onChange="saveTasks('<?php echo $row["taskid"]; ?>', **this.selectedIndex** ,'vendorname')">
函数将其写回数据库。
this.selectedIndex
问题是我也有PHP函数和this.selectedIndex
作为HTML函数。
我也试过JS而不是<div class="control-group" onChange= "saveTasks('<?php echo $row["taskid"]; ?>', **myFunction()** ,'vendorname')">
(下面提到):
@Component
public class CustomAuthenticationProviderImpl implements UnalAuthenticationProvider {
@Autowired
private CustomUserDetailService customUserDetailService;
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
String username = authentication.getName();
String password = (String) authentication.getCredentials();
UserDetails user = null;
try{
user = (UserDetails) customUserDetailService.loadUserByUsername(username);
}
catch(UsernameNotFoundException ex){
System.out.println("User name not found");
throw ex;
}
if (user == null) {
throw new BadCredentialsException("Username not found.");
}
if (!password.equals(user.getPassword())) {
throw new BadCredentialsException("Wrong password.");
}
Collection<? extends GrantedAuthority> authorities = user.getAuthorities();
return new UsernamePasswordAuthenticationToken(user, password, authorities);
}
public boolean supports(Class<?> arg0) {
return true;
}
}
但不知道什么是正确的语法。