Kotlin是否支持命名的正则表达式组?
命名的正则表达式组看起来像这样: (?<name>...)
在Spring中,你不能简单地@Transactional从同一个实例调用方法,因为AOP代理的东西.自我注入并从自代理实例调用该方法是不是一个好主意?你看到任何缺点吗?
我有一个名为SongDescription的自定义UserControl:
<UserControl x:Class="DPTestAp.SongDescription" ...>
<Grid x:Name="LayoutRoot">
<DockPanel Height="50">
<TextBlock x:Name="title" Text="{Binding name}" Width="100" Height="30"/>
<TextBox x:Name="lyrics"/>
</DockPanel>
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
我添加了DependencyProperty:
public partial class SongDescription : UserControl
{
public static readonly DependencyProperty SongProperty = DependencyProperty.Register("Song", typeof(Song), typeof(SongDescription));
public Song Song
{
get
{
return (Song)GetValue(SongProperty);
}
set
{
SetValue(SongProperty, value);
updateLyrics()
}
}
private void updateLyrics()
{
lyrics.Text = Song.lyrics;
}
public SongDescription()
{
InitializeComponent();
}
}
Run Code Online (Sandbox Code Playgroud)
问题是:如何将某些东西绑定到这个SongProperty?我在我的主窗口中使用SongDescription,如下所示:
<local:SongDescription x:Name="songDescription" Song="{Binding DataContext}"/>
Run Code Online (Sandbox Code Playgroud)
我无法让我的TextBox 歌词显示歌词.在主窗口中,我尝试将DataContext设置为songDescription,如下所示:
songDescription.DataContext = new Song() { name="Home", …Run Code Online (Sandbox Code Playgroud) 我的问题是:当我尝试登录我的自定义登录页面时,它会再次将我重定向到登录页面(如果我输入正确或错误的凭据,则无关紧要).在调试中我没有达到我的自定义UserDetailService也很奇怪,我认为这意味着spring甚至不会检查用户的凭据.
我有自定义登录表单/WEB-INF/jsp/login.jsp:
...
<form name='loginForm' action="<c:url value='j_spring_security_check' />" method='POST'>
<table>
<tr>
<td>User:</td>
<td><input type='text' name='j_username' value=''></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password' /></td>
</tr>
<tr>
<td colspan='2'><input name="submit" type="submit"
value="submit" /></td>
</tr>
</table>
<input type="hidden" name="${_csrf.parameterName}"
value="${_csrf.token}" />
</form>
...
Run Code Online (Sandbox Code Playgroud)
这是配置:
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests().antMatchers("/", "/welcome", "/resources/**").permitAll()
.anyRequest().authenticated().and()
.formLogin().loginPage("/login").failureUrl("/login?error").permitAll().and()
.logout().logoutUrl("/login?logout").permitAll();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder()); …Run Code Online (Sandbox Code Playgroud) 我想实现表的可扩展行功能.假设我们有一个包含任务名称和任务复杂性的表.单击任务时,任务说明如下所示.我尝试用ReactJS(在render方法中)这样做:
if (selectedTask === task.id) {
return [
<tr>
<td>{task.name}</td>
<td>{task.complexity}</td>
</tr>,
<tr>
<td colSpan="2">{task.description}</td>
</tr>
];
} else {
return <tr>
<td>{task.name}</td>
<td>{task.complexity}</td>
</tr>;
}
Run Code Online (Sandbox Code Playgroud)
它不起作用.它说:
A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object
我也尝试在div中包装2行,但我得到错误的渲染.请提出正确的解决方案.
java ×2
binding ×1
html ×1
html-table ×1
javascript ×1
jsp ×1
kotlin ×1
reactjs ×1
regex ×1
regex-group ×1
spring ×1
spring-aop ×1
spring-boot ×1
spring-mvc ×1
wpf ×1