java响应代码 java platform se binary未响应( 六 )


或者
"/
这样的情况...
错误:Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update原因与解决: 因为Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示数据库名称)这样的属性,将该属性删除就可以了
错误:org.hibernate.ObjectDeletedException: deleted object would be resaved by cascade (remove deleted object from associations)
原因与解决:
方法1 删除Set方的cascade
方法2 解决关联关系后 , 再删除
方法3 在manytoone方增加cascade 但值不能是none
最后一招:
检查一下hashCode equals是否使用了id作为唯一标示的选项了;我用uuid.hex时是没有问题的;但是用了native , 就不行了,怎么办?删除?。?
问题:今天用Tomcat 5.5.12 , 发现原来很好用的系统不能用了 , 反复测试发现页面中不能包含taglib,否则会出现以下提示:HTTP Status 500 type Exception reportMessage description The server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "METAINF/tlds/strutsbean.tld" from JAR file"file:*****/WEBINF/lib/struts.jar":原因:更新了工程用的lib文件夹下的jar,发布时也发布了servlet.jar和jspapi.jar 。解决:把jspapi.jar删除就解决这个问题了 。
在Java中,Button类的响应函数怎么写下面以点击按钮后改变窗口背景色为例:
import java.awt.*;
import java.awt.event.*;
public class MyAWTDemo extends Frame{
public MyAWTDemo() {
Button bt = new Button("=点击按钮,改变背景色=");
//给按钮添加响应代码
bt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//这里写,你想点击按钮后 , 执行的代码
setBackground(new Color((int)(Math.random()*256),(int)(Math.random()*256),(int)(Math.random()*256)));
}
});
add(bt);
setLayout(new FlowLayout());
setTitle("窗口标题");
setSize(260, 100);
setLocationRelativeTo(null);
setVisible(true);
//给窗口添加一个响应代码,当我们点击窗口右上角的关闭按钮时,系统就退出JVM虚拟机
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);//系统退出
}
});
}
public static void main(String[] args) {
new MyAWTDemo();
}
}
效果图
JAVA按钮响应的问题,下面是代码经调试,已经解决:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class GUI1 extends JFrame {
private JButton b1 = new JButton("button1");
private JButton b2 = new JButton("button2");
private JTextField txt = new JTextField(10);
private ActionListener bl = new ActionListener() { // 定义一个内部类
public void actionPerformed(ActionEvent e) {
String name = ((JButton) e.getSource()).getText();
txt.setText(name);
}
};
public GUI1(int a, int b) {
setSize(a, b);
b1.addActionListener(bl);
b2.addActionListener(bl);
setLayout(new FlowLayout());
add(b1);
add(b2);
add(txt);
}
public static void main(String[] args) {
GUI1 s = new GUI1(200, 110);
s.setDefaultCloseOperation(EXIT_ON_CLOSE);
s.setLocationRelativeTo(null);
s.setVisible(true);
}
}
java什么是响应代码?这个不是java有的东西.这是http协议的东西.
http简单的说,包括request和response.
request就是请求,包括请求头,请求参数,请求地址等...
response就是响应.同样包括头,参数,还有一个就是响应码.

推荐阅读