我有一个多模块项目,像这样:
main-project/
module1/
module2/
sub-module1/
sub-module2/
sub-module3/
...
module3/
module4/
...
Run Code Online (Sandbox Code Playgroud)
我需要在Maven2中定义一组属性(取决于我想要释放项目的环境).我不会使用<properties>因为有很多属性...因此,我使用Properties Maven2插件.
属性文件位于main-project/目录中.如何在主pom.xml中设置正确的目录,以便为任何子项指定在哪里找到属性文件?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>???/env_${env}.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
如果我只设置<file>env_${env}.properties</file>,那么当Maven2编译第一个模块时,它将找不到该main-project/env_dev.properties文件.如果我设置<file>../env_${env}.properties</file>,那么将在父级别或任何子模块级别引发错误...
我正在对第三方类进行覆盖,我想要取消对它的所有检查(因为我只保留它直到接受补丁).
有没有办法抑制文件的所有检查?
我尝试使用"*",但失败了.
session.createQuery("Select attribute from GoodsSection tgs " +
"join gs.ascendants ags join ags.attributes attribute " +
"where attribute.outerId = :outerId and tgs = :section ")
.setString("outerId", pOuterId)
.setEntity("section", section)
.setMaxResults(1)
.uniqueResult();
Run Code Online (Sandbox Code Playgroud)
看起来很好,但结果是
java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
\-[IDENT] IdentNode: 'attribute' {originalText=attribute}
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:145)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:705)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:529)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
Run Code Online (Sandbox Code Playgroud)
为什么?怎么了?
在以下代码中,用户从ComboBox中选择一个客户,该客户的信息显示在框中.
现在我也想让RadioButtons使用相同的功能.我有RadioButtons来显示客户的ObservableCollection,但我怎样才能让IsChecked工作,即什么相当于SelectedItemRadioButtons?
XAML:
<Window.Resources>
<DataTemplate x:Key="CustomerShowTemplate">
<Border CornerRadius="5"
Background="#eee"
Padding="5"
HorizontalAlignment="Left">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="14" FontWeight="Bold" Text="{Binding FirstName}"/>
<TextBlock Text=" "/>
<TextBlock FontSize="14" FontWeight="Bold" Text="{Binding LastName}"/>
</StackPanel>
<TextBlock Text="{Binding Path=HireDate,
StringFormat='Hired on {0:MMM dd, yyyy}'}"/>
</StackPanel>
</Border>
</DataTemplate>
<DataTemplate x:Key="CustomerComboBoxTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FirstName}"/>
<TextBlock Text=" "/>
<TextBlock Text="{Binding LastName}"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CustomerRadioButtonTemplate">
<RadioButton GroupName="CustomerRadioButtonGroup"
IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsSelected}">
<TextBlock Text="{Binding LastName}"/>
</RadioButton>
</DataTemplate>
</Window.Resources>
<DockPanel LastChildFill="False" …Run Code Online (Sandbox Code Playgroud) 可能重复:
如何在c#中的方法中将引用作为参数传递
如何在C#中传递引用作为参数,如c ??
在SQL Server 2005中,如何将用户名的变量用于GRANT或DENY对具有数据库的对象的权限?我试过了:
DECLARE @username varchar(30)
SET @username = 'DOMAIN\UserName'
GRANT SELECT ON [mytable] TO @username
GRANT UPDATE([field one], [field two], [field three]) ON [mytable] TO @username
Run Code Online (Sandbox Code Playgroud)
我明白了Incorrect syntax near '@username',然后我将它包裹在[和]中
GRANT SELECT ON [mytable] TO [@username]
Run Code Online (Sandbox Code Playgroud)
然而,这导致了Cannot find the user '@username', because it does not exist or you do not have permission.如何在不输入每个语句的用户名的情况下执行此操作?我想这样做是为了减少任何拼写错误的机会(这可能导致错误的用户获得权限设置)
我发现以下asp.net代码在从数据库提供文件时非常有用:
Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
Run Code Online (Sandbox Code Playgroud)
这允许用户将文件保存到他们的计算机,然后决定如何使用它,而不是尝试使用该文件的浏览器.
使用内容处置响应标头还可以做些什么?
http httpresponse httpwebresponse content-disposition http-headers
我创建了一个jQuery内容切换器.一般来说,它工作正常,但它有一个问题.如果多次单击侧面的链接,有时会显示多条内容.
问题最有可能出现在click事件中.这是代码:
$('#tab-list li a').click(
function() {
var targetTab = $(this).attr('href');
if ($(targetTab).is(':hidden')) {
$('#tab-list li').removeClass('selected');
var targetTabLink = $(this).parents('li').eq(0);
$(targetTabLink).addClass('selected');
$('.tab:visible').fadeOut('slow',
function() {
$(targetTab).fadeIn('slow');
}
);
}
return false;
}
);
Run Code Online (Sandbox Code Playgroud)
我已经尝试为转换添加锁定,以便在转换发生时忽略进一步的点击,但无济于事.我还尝试使用以下内容防止在某些内容已经动画时触发转换:
if ($(':animated')) {
// Don't do anything
}
else {
// Do transition
}
Run Code Online (Sandbox Code Playgroud)
但它似乎总是认为事物是动画的.有什么想法可以防止多次触发动画?
我已经实现了jQuery粗框在我的网页,以显示bix.I用厚框的iFrame模式来做this.Now我有正在其中显示在页面中的asp.net链接按钮光另一个页面内容灯箱.当点击此链接(在内页中)时,我想从客户端关闭灯箱.我必须使用哪个功能?有什么建议?
是否有像Apache Tomcat这样的应用服务器,我可以使用像网络语言一样的Lisp?
我最近和Arc/Anarki和Clojure一直在玩.但我真正想念的是像Apache的mod_arc或mod_clojure.我真正想念的是用于Lispy网络语言的良好Apache集成.
Arc和Clojure都使用您在代码中启动的内置Web服务器.我想要Apache httpd给我的所有功能,弹性和可伸缩性.是否有人在使用Arc模块进行Arc或Clojure?我可以使用另一种类似Lisp的语言与Apache一起使用吗?
我来自PHP和Perl的背景.但是在C和/ bin/sh方面也有很多经验.从我开始编写Web应用程序开始,我就使用cgi-bin和stdin来创建C二进制文件.
java ×2
jquery ×2
apache ×1
c# ×1
checkstyle ×1
clojure ×1
hibernate ×1
hql ×1
http ×1
http-headers ×1
httpresponse ×1
javascript ×1
lisp ×1
maven-2 ×1
properties ×1
radio-button ×1
sql-server ×1
thickbox ×1
tomcat ×1
wpf ×1
xaml ×1