I have deployed a Grails 2.2.1 application to a remote server. After a few hours, when I access to home page of the application, I see the following exception:
Error 500: Internal Server Error
URI
/DocGemStudioZoccali/
Class
java.net.SocketException
Message
Broken pipe
Trace
Line | Method
->> 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - …Run Code Online (Sandbox Code Playgroud) 我有一个带有组合框列的数据网格
<DataGridComboBoxColumn x:Name="DataGridComboBoxColumnBracketType" Width="70" Header="Tipo di staffa" SelectedValueBinding="{Binding type, UpdateSourceTrigger=PropertyChanged}">
</DataGridComboBoxColumn>
Run Code Online (Sandbox Code Playgroud)
我想要一个仅在用户将值更改为组合框时触发的事件.我该如何解决这个问题?
我已经将Grails war部署到我安装了Apache Tomcat 7的服务器中,但它没有启动.这是cattraina.out中给出的堆栈跟踪:
2014-07-05 12:07:55,875 [http-bio-8080-exec-53] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invo
cation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
... 5 more
2014-07-05 12:07:55,883 [http-bio-8080-exec-53] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name …Run Code Online (Sandbox Code Playgroud) 我正在开发一个WPF C#应用程序,我在修改对象时有一个奇怪的行为.我试着以一般方式解释它.假设您有一个类的对象,如下所示:
public class A
{
int one;
bool two;
List<B> listofBObjects;
}
Run Code Online (Sandbox Code Playgroud)
其中B是:
public class B
{
int three;
int four;
}
Run Code Online (Sandbox Code Playgroud)
我将一个A类的实例和一个B类的实例从一个窗口传递到另一个窗口,只在第二个窗口中定义了两个类型为A和B的变量,并在Show()方法之前传递它们,并使用以下代码执行窗口的实例FirstWindow:
SecondWindow newWindow = new SecondWindow();
newWindow.instanceOfA = this.instanceOfA; //instanceOfA is of type A
newWindow.instanceOfB = this.instanceOfA.listOfBObjects[0]; //instanceOfB is of type B
newWindow.Show();
Run Code Online (Sandbox Code Playgroud)
如果我必须重复两次这个代码(也就是说,打开两次窗口),在第一次执行时一切都按预期工作,实际上如果我修改instanceOfB变量中的值,我也会在instanceOfA变量中看到修改.但是,在第二次执行中,修改instanceOfB不会影响instanceOfA......修改是在newWindow.例如:
this.instanceOfB.three++;
this.instanceOfB.four--;
Run Code Online (Sandbox Code Playgroud)
想象一下你在FirstWindow.单击一个按钮,打开SecondWindow,如上所述传递两个变量.在SecondWindow中,做一些修改,单击OK并关闭SecondWindow,将控制权返回给FirstWindow.如果我按下相同的按钮,我会重新打开SecondWindow.如果我现在进行修改,它们不会影响这两个变量.
我尝试在控制台中使用控制表达式查看控制台中的两个变量(在VS2012中),我看到,在代码的第一次传递中,当执行上面的代码时,两个变量都会发生变化,但在第二次代码传递中,只会instanceOfB发生变化...
编辑:按照我用来将参数传递给SecondWindow的代码...类型在下面解释
IntermediatePosition obj = ((FrameworkElement)sender).DataContext as IntermediatePosition; //IntermediatePosition is Class B
IntermediatePositionsSettingsWindow ips = new IntermediatePositionsSettingsWindow();
ips.currentIntermediatePosition …Run Code Online (Sandbox Code Playgroud) 我有一个DataGrid带DataGridCheckBoxColumn.网格具有与对象列表的绑定.我想要的是,如果选中了N个复选框,则取消选中已禁用,但我不知道如何执行禁用.
<DataGridCheckBoxColumn
x:Name="IsFixedByBracketColumn"
Header="Fissato con staffa"
Binding="{Binding isFixedByBracket, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="False">
<DataGridCheckBoxColumn.ElementStyle>
<Style TargetType="CheckBox">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition
Binding="{Binding
HasMaxNumberReached,
RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
Value="true"/>
<Condition
Binding="{Binding
IsChecked,
RelativeSource={RelativeSource Self}}"
Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="IsEnabled" Value="False"/>
</MultiDataTrigger>
</Style.Triggers>
<EventSetter
Event="CheckBox.Checked"
Handler="DataGridCheckBoxColumn_Checked" />
</Style>
</DataGridCheckBoxColumn.ElementStyle>
</DataGridCheckBoxColumn>
Run Code Online (Sandbox Code Playgroud)
活动代码:
private void DataGridCheckBoxColumn_Checked(object sender, RoutedEventArgs e)
{
CheckBox cb = (CheckBox)sender;
if (cb.IsChecked == true)
{
this.numberOfCheckboxesChecked++;
}
else
{
this.numberOfCheckboxesChecked--;
}
if (this.numberOfCheckboxesChecked >= maxNumOfPointsPerSide)
{
this.HasMaxNumberReached = true;
}
else
{ …Run Code Online (Sandbox Code Playgroud) 在我的grails应用程序中,我需要从数据库中获取一些数据并在gsp页面中显示它.我知道我需要从控制器获取数据,例如
List<Event> todayEvents = Event.findAllByStartTime(today)
Run Code Online (Sandbox Code Playgroud)
得到与日,所有活动今天 现在,我怎么能使其在GSP页面?我如何通过事件对象的清单提交给GSP?
非常感谢
在我的WPF项目中,我使用复选框列构建了以下数据网格:
XAML
<DataGrid AutoGenerateColumns="False" TargetUpdated="IsIntermediatePointFixedByBracketDataGrid_TargetUpdated">
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{Binding isFixedByBracket, NotifyOnTargetUpdated=True }" />
</DataGrid.Columns>
</DataGrid>
Run Code Online (Sandbox Code Playgroud)
C#
private void IsIntermediatePointFixedByBracketDataGrid_TargetUpdated(object sender, DataTransferEventArgs e)
{
DataGrid dg = (DataGrid)sender;
if (dg.SelectedIndex != -1
&& ((IsFixedByBracketElement)dg.SelectedItem).isFixedByBracket != this.currentIntermediatePosition.isFixedByBracket[dg.SelectedIndex])
{
this.currentIntermediatePosition.isFixedByBracket[dg.SelectedIndex] =
((IsFixedByBracketElement)dg.SelectedItem).isFixedByBracket;
}
}
Run Code Online (Sandbox Code Playgroud)
当我选中/取消选中一个复选框时,会抛出TargetUpdated事件,但只有在我选择并取消选中包含该复选框的单元格时,该值才会更改.为什么会发生这种情况?我该如何改变这种行为?
我需要访问存储在参数中的项目,该参数表示多选中的所选元素.我使用以下代码将选定的项目从gsp传递给控制器到remoteFunction:
params: '\'receiptItemsSelected=\' + jQuery(this).val()'
Run Code Online (Sandbox Code Playgroud)
现在,按照此处讨论中的代码,我使用闭包来获取每个值,但是如果我执行多选,则receiptItemsSelected的大小始终为1,但值例如为1,2.要将值作为列表获取,我在控制器中完成了以下操作
params.list("receiptItemsSelected")
Run Code Online (Sandbox Code Playgroud)
但如果我在multiselect中选择两个项目,但它总是只有一个元素,它就不会给我两个元素.问题是:如果我选择两个元素,我如何获得每个元素并在控制器中使用它?我怎么能把那些元素当作长而不是字符串呢?谢谢
在我的Joomla模板中,我想覆盖一些样式,所以我创建了自己的CSS并添加了样式,还有媒体查询.最重要的是,只有当我使用!important关键字时,某些东西根本不起作用.例如:
<div id="content_right" class="span3">
Run Code Online (Sandbox Code Playgroud)
在这个div我有课和id.我无法修改类,因为它会影响其他div进入模板,所以我想通过id添加一些样式.我添加了它,但它不起作用.我已经使用Firebug进行了检查,并且css已正确加载.可能是什么问题呢?
我想创建一个 WPF Datagrid,它具有行和列的标题,对应于以下 excel 网格:
特别是,蓝色单元格是固定的,这意味着我认为它们需要是标题。
请注意,我想创建一个包含每一行的 List,T 如下:
class T
{
double ag;
double fZero;
double tcStar;
}
Run Code Online (Sandbox Code Playgroud)
如何使用 DataGrid 创建它?