在我的GWT项目中,我想:
为FileUpload小部件设置过滤器,以便它只接受JPG文件.
myButton如果调用的FileUpload小部件chooser选择了任何文件,则启用.myButton否则禁用.
这是我的第2点的代码,但它不起作用.有任何想法吗?提前致谢!
chooser.addAttachHandler(new Handler() {
public void onAttachOrDetach(AttachEvent event) {
if(chooser.isAttached()==false && myButton.isEnabled()==true)
myButton.setEnabled(false);
else if(chooser.isAttached()==true && myButton.isEnabled()==false)
myButton.setEnabled(true);
} });
Run Code Online (Sandbox Code Playgroud) 我正在使用ant任务运行javadoc:
<target name="javadoc" description="create javadoc">
<delete dir="javadoc" />
<mkdir dir="javadoc" />
<javadoc destdir="javadoc">
<fileset dir="src/main/java" includes="sk/**" />
</javadoc>
</target>
Run Code Online (Sandbox Code Playgroud)
我想更改默认的index.html页面以提供简短的用户指南.我可以改变index.html将它复制到其他地方并在javadoc的ant任务完成后重写它,但这似乎有点愚蠢.是否有更常见的方法来实现这一目标?谢谢
我在哪里可以找到IntelliJ IDEA Ultimate 11.02中的Coverage Tool窗口?在教程中,他们说它在View |中 工具窗口| 覆盖.但在我的IDEA中它不是,见图:

我启用了coverage插件.
换句话说:目前使用SharePoint 2007更容易获得工作,但是当我学习2010年时,我将能够使用仅来自2010年知识的旧版本吗?我还不知道任何SharePoint.
在开始使用SharePoint之前我应该知道什么?C#和ASP.NET(MVC)足够吗?
基本上,我喜欢默认的主题小部件.但是,我需要在DecoratedStackPanel小部件上更改字体大小.
我认为应该有这样的事情:
decoratedStackPanel.getElement().getStyle().setProperty("fontSize", "12pt");
Run Code Online (Sandbox Code Playgroud)
但是,"fontSize"不是属性的有效名称,我没有找到如何获取所有元素属性的方法.因此,我不知道正确的属性名称.
有任何想法吗?
请不要发布有关继承小部件或编写自定义CSS的信息.我喜欢默认的但字体大小.这应该是可能的.
我试图使用本机MySQL的MD5加密函数,因此我在映射文件中定义了自定义插入。
<hibernate-mapping package="tutorial">
<class name="com.xorty.mailclient.client.domain.User" table="user">
<id name="login" type="string" column="login"></id>
<property name="password">
<column name="password" />
</property>
<sql-insert>INSERT INTO user (login,password) VALUES ( ?, MD5(?) )</sql-insert>
</class>
</hibernate-mapping>
Run Code Online (Sandbox Code Playgroud)
然后,我创建用户(非常简单的POJO,仅包含2个字符串-登录名和密码)并尝试保留它。
session.beginTransaction();
// we have no such user in here yet
User junitUser = (User) session.load(User.class, "junit_user");
assert (null == junitUser);
// insert new user
junitUser = new User();
junitUser.setLogin("junit_user");
junitUser.setPassword("junitpass");
session.save(junitUser);
session.getTransaction().commit();
Run Code Online (Sandbox Code Playgroud)
实际发生了什么?
已创建用户,但参数顺序相反。他具有登录名“ junitpass”,“ junit_user”已被MD5加密并存储为密码。
我怎么了 谢谢
编辑:添加POJO类
package com.xorty.mailclient.client.domain;
import java.io.Serializable;
/**
* POJO class representing user.
* …Run Code Online (Sandbox Code Playgroud) 考虑这个界面:
public interface Listenable {
void listen();
}
Run Code Online (Sandbox Code Playgroud)
考虑这个实现:
public class Listener implements Listenable {
public void listen() {
System.out.println("I am listening");
}
}
Run Code Online (Sandbox Code Playgroud)
现在我正在通过RMI进行远程处理,并且我将这些类的实例传递给服务器(也许一些黑魔法代理在那里产生,不确定).
到目前为止我能够发明的唯一解决方案,我不得不说它非常愚蠢,就是将此代码添加到Listener类:
public class Listener implements Listenable {
private double id;
private Random rand = new Random();
public Listener() {
this.id = rand.nextDouble();
}
public void listen() {
System.out.println("I am listening");
}
public int hashCode() { ... } // calculate from id
// same for equals - compare by id
}
Run Code Online (Sandbox Code Playgroud)
这通常有效,但我们都知道这是多么邪恶:/如何处理这种情况? …
我正在构建RESTful移动应用程序,我喜欢找不到资源时的默认行为.jQuery Mobile显示了这个:

但是,当我在onError中执行自定义AJAX时(因为找不到资源)我想显示奇特的消息(但是,我的代码没有任何反应,默认行为被忽略):
$("#some-place").bind("pageshow", function() {
$.ajax({
type: "POST",
url: "some-place/places.json",
cache: false,
dataType: "json",
success: onSuccessInitPlaces,
error: onErrorInitPlaces
});
return false;
});
function onSuccessInitPlaces(data, status) {
// do stuff, not important atm
}
function onErrorInitPlaces(data, status) {
// pseudocode I'd like to invoke for real
// should show attached picture
invokeFancyErrorLoadingPage();
}
Run Code Online (Sandbox Code Playgroud) 当我在spring mvc中放入模型中的东西时:
@RequestMapping(method = RequestMethod.GET)
public String createForm(Model model) {
model.addAttribute("item", new Item());
return "item/new";
}
Run Code Online (Sandbox Code Playgroud)
IntelliJ在相应的JSP页面中未解析bean"item".我的意思是,它工作得很好,但自动完成不会:/
在这种情况下有没有办法自动完成?
如何在GWT中显示AJAX"消息框"?我知道我可以使用这个Window.alert()功能,但这太丑陋/烦人了.有内置功能吗?
谢谢!
伊凡
java ×5
gwt ×3
ajax ×1
ant ×1
asp.net ×1
asp.net-mvc ×1
c# ×1
css ×1
equals ×1
file-upload ×1
handler ×1
hibernate ×1
javadoc ×1
javascript ×1
jquery ×1
jsp ×1
messagebox ×1
networking ×1
orm ×1
remoting ×1
sharepoint ×1
spring ×1
spring-mvc ×1