小编ehs*_*n7b的帖子

NetBeans 7上的Google App Engine

是否有任何插件或替代方法在Netbeans 7上使用Google App Engine ?

  • 部署
  • 代码完成
  • ...

google-app-engine netbeans netbeans-plugins netbeans-7 netbeans7.0

7
推荐指数
1
解决办法
7564
查看次数

如何在Ruby on Rails中实现由JSF 2.0(Primefaces)驱动的UI魔术

问题1) 我想知道轨道上的红宝石是否具有功能类似于primefaces的宝石.为什么我要问的是

如果你使用primefaces(http://www.primefaces.org/showcase-labs/ui/home.jsf),开发人员无需担心javascript或jquery的东西.

据我所知,JSF是一个规范,基于规范可用的各种实现,primefaces是这些实现的ui框架,primefaces有很多基于jquery和javascript库的组件.或多或少的primefaces只是作为一个javascript包装器.我使用primefaces,你主要专注于业务逻辑,不需要担心UI.

我受到红宝石轨道方法的启发,并且有很多宝石可供选择.

我的问题是,是否有可用于轨道上的ruby的gem或UI框架,类似于由primefaces驱动的UI魔术

注意:我不是在寻找纯粹的jquery或dojo东西,我正在寻找用于ruby on rails的UI组件驱动的东西.使用曲面工作项目的人和使用rails的项目将100%理解我的问题.

问题2) 我想知道与用户界面相关的宝石列表.我要问的是为了在轨道上的ruby上创建非常小众的用户界面需要什么东西(框架或宝石).

ruby ruby-on-rails jruby jsf-2 ruby-on-rails-3

5
推荐指数
1
解决办法
2286
查看次数

JSF <c:if <c:选择问题

我是JSF的新手,在表单中显示条件部分时遇到一些奇怪的问题.

我的面孔:

<h:form id="animalForm">
    <h:selectOneRadio id="animal" onchange="submit()" value="#{index.animal}">
      <f:selectItem itemLabel="Cat" itemValue="1"/>
      <f:selectItem itemLabel="Dog" itemValue="2"/>
    </h:selectOneRadio>
  </h:form>
  <h:outputText value="#{index.animal}"/>
  <c:if test="#{index.animal eq 1}">
    <h:outputText value="Cat"/>
  </c:if>
  <c:if test="#{index.animal eq 2}">
    <h:outputText value="Dog"/>
  </c:if>
Run Code Online (Sandbox Code Playgroud)

还有我的豆子:

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;


@ManagedBean(name = "index")
@RequestScoped
public class IndexBean {
  public static final int CAT = 1;
  public static final int DOG = 2;
  private int animal;

  public IndexBean() {

  }

  public int getAnimal() {
    return animal;
  }

  public void setAnimal(int animal) {
    this.animal = …
Run Code Online (Sandbox Code Playgroud)

java jsf managed facelets javabeans

4
推荐指数
1
解决办法
6903
查看次数

JSF和PrimeFaces战略

什么是或可能是最佳做法?

  1. 使用标准JSF组件并在需要时通过PrimeFaces组件将它们组合在一起(例如,当需要DHTML或AJAX组件时)
  2. 忘记所有JSF组件并尝试尽可能多地使用所有PrimeFaces组件

请解释一下,告诉我你的经历.

提前致谢...

jsf primefaces jsf-2

4
推荐指数
2
解决办法
2130
查看次数

Google Closure使用this关键字绑定/解决问题

什么是Google Closure解决thisJavaScript回调函数中关键字问题的解决方案.它在OO风格编程中非常有用.

Google Closure中是否存在OOP的约定或样式?

更新 如何在ViewportSizeMonitor处理程序中访问this.darklayer ???

    goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.math.Size');
goog.require('goog.style');

goog.require('goog.dom.ViewportSizeMonitor');

goog.provide('ehsun7b.ajax.AjaxBox');

ehsun7b.ajax.AjaxBox = function (url, containerClass) {
  try {
    this.url = url;
    this.containerClass = containerClass;

    var viwportSize = goog.dom.getViewportSize();
    this.darklayer = goog.dom.createDom("div", {
      "style": "width: " + viwportSize.width + "px;" + "height: " + 
      viwportSize.height + "px;" +
      "background-image: url('css/img/50black.png');" +
      "z-index: 1000;" +
      "position: absolute;" +
      "left: 0px; top: 0px;"
    });

    var vsm = new goog.dom.ViewportSizeMonitor(); …
Run Code Online (Sandbox Code Playgroud)

javascript oop bind this google-closure-library

4
推荐指数
1
解决办法
3758
查看次数

Google App Engine上的RESTful Web服务

首先,我需要说我在Google App Engine中没那么有经验.

我知道我们可以在GAE上部署RESTful Web服务(JERSEY)

而且我也知道RESTLET有一个专门针对GAE的版本.

我想从那些使用两种方法的人那里获得建议.

例如,为JERSEY配置GAE应用程序太困难或困难??? 或者例如使用RESTLET有什么缺点?还是太厚了(RESTLET)?

谢谢

google-app-engine web-services jersey restlet

4
推荐指数
1
解决办法
2164
查看次数

哈希函数使用和更受欢迎

我知道所有哈希函数的列表太长了.我只是想知道在日常IT实践任务中使用的最受欢迎的那些.我知道MD5,SHA1,SHA2(256和512)非常受欢迎.我可以为这5种算法添加其他哈希函数吗?

我想开发一个哈希工具,我只想包含那些开发人员真正需要的算法.

security hash

4
推荐指数
1
解决办法
3467
查看次数

Jpedal图书馆是免费的吗?

Jpedal图书馆完全免费吗?我注意到下载链接提到了试用版!:(

java pdf jpedal

2
推荐指数
1
解决办法
9677
查看次数

使用Google Closure Library阻止事件传播

使用Google Closure库:

如何处理单击element例如a div但阻止event handler在用户单击该元素的子元素时触发.

例如,在下面的代码中我想触发event handler用户单击时,div1但是当他/她单击"span1"时,我希望event handler在不触发处理程序的情况下调用另一个div1.

<div style="width: 400px" id="div1">
 <span id="span1">click me to reload</span>
 click here to Toggle accordion
</div>
Run Code Online (Sandbox Code Playgroud)

UPDATE

JS代码:

/**** accordion ***/
var panels = goog.dom.getElementsByClass('newsColumnHeader', goog.dom.getElement('accordionContainer'));

var anims  = {};
var open   = null;

goog.array.forEach(panels, function(pane){
  var animation = new goog.ui.AnimatedZippy(pane, goog.dom.getNextElementSibling(pane));
  goog.events.listen(animation, goog.ui.Zippy.Events.TOGGLE, zippyToggle);
  anims[goog.getUid(animation)] = animation;
});

function zippyToggle(event) {      
  var uid = goog.getUid(event.target);                  
  // simple …
Run Code Online (Sandbox Code Playgroud)

javascript events javascript-events google-closure google-closure-library

2
推荐指数
1
解决办法
2600
查看次数

JTree:为各个组设置自定义打开/关闭图标

  1. 我知道如何在JTree中设置自定义叶图标
  2. 我知道如何为所有组节点设置自定义关闭/打开图标

但我无法根据组节点名称设置自定义打开/关闭图标,例如节点可以称为电子邮件(因此有一个包络图标很好)或者一组可能被称为任务等等.

我试图通过重写getTreeCellRendererComponent类的方法来做到这一点DefaultTreeCellRenderer

但是改变icon当前的电流node只会影响下一个节点!

如何为各个组设置自定义打开/关闭图标?

请看一下我的代码:

Employee.java

package com.ehsunbehravesh.swing;

import java.util.Random;

public class Employee {

  public String name;
  public int id;
  public boolean isBoss;
  public Employee[] employees;

  public Employee(String name, boolean isBoss) {
    this.name = name;
    this.isBoss = isBoss;
    this.id = new Random(System.currentTimeMillis()).nextInt(Integer.MAX_VALUE);
  }  

  @Override
  public String toString() {
    return this.name;
  }

    static String randomName() {
    String chars = "abcdefghijklmnopqrstuvwxyz";
    StringBuilder builder = new StringBuilder();
    Random r = new Random(System.currentTimeMillis());
    int length …
Run Code Online (Sandbox Code Playgroud)

java icons swing jtree treecellrenderer

2
推荐指数
2
解决办法
1万
查看次数

Glassfish管理控制台故障

我在Windows 2003上使用带有JDK 6u24的glassfish 3.0.1.当我启动服务器并尝试登录管理控制台(4848)时,我将收到以下错误消息:

[#|2011-02-24T12:59:37.578+0330|INFO|glassfish3.0.1|javax.enterprise.system.std.
com.sun.enterprise.v3.services.impl|_ThreadID=25;_ThreadName=http-thread-pool-48
48-(2);|Cannot refresh Catalog : Connection timed out: connect|#]
Run Code Online (Sandbox Code Playgroud)

更新

[#|2011-02-24T12:58:51.343+0330|INFO|glassfish3.0.1|null|_ThreadID=24;_ThreadNam
e=Thread-23;|The Admin Console is already installed, but not yet loaded.|#]

[#|2011-02-24T12:58:51.343+0330|INFO|glassfish3.0.1|null|_ThreadID=24;_ThreadNam
e=Thread-23;|The Admin Console is loading...|#]

[#|2011-02-24T12:58:52.296+0330|INFO|glassfish3.0.1|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-23;|Created HTT
P listener http-listener-1 on port 80|#]

[#|2011-02-24T12:58:52.296+0330|INFO|glassfish3.0.1|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-23;|Created HTT
P listener http-listener-2 on port 8181|#]

[#|2011-02-24T12:58:52.296+0330|INFO|glassfish3.0.1|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-23;|Created HTT
P listener admin-listener on port 4848|#]

[#|2011-02-24T12:58:52.343+0330|INFO|glassfish3.0.1|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-23;|Created vir
tual server server|#]

[#|2011-02-24T12:58:52.343+0330|INFO|glassfish3.0.1|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-23;|Created vir
tual server __asadmin|#]

[#|2011-02-24T12:58:53.531+0330|INFO|glassfish3.0.1|javax.enterprise.system.cont
ainer.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-23;|Virtual ser
ver server loaded system default web …
Run Code Online (Sandbox Code Playgroud)

java glassfish application-server java-ee

1
推荐指数
1
解决办法
5275
查看次数

JSP resourceBundle

我没有问题propertiesJSP位于网站根目录(使用ResourceBundle )的文件加载和使用文件,但是当我尝试propertiesJSP位于目录中的文件中加载相同的文件时,它失败并说无法找到资源!

位于目录中的页面代码

<%@page import="org.apache.log4j.Logger"%>
<%@page import="com.persiangulfcup.utility.LogUtils"%>
<%@page import="java.util.ResourceBundle"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
  Logger logger = LogUtils.getLogger("page/contact");
  ResourceBundle lbls = null;
  ResourceBundle msgs = null;
  try {
    lbls = ResourceBundle.getBundle("labels");
    msgs = ResourceBundle.getBundle("messages");
  } catch (Exception ex) {
    logger.fatal(ex);
  }
%>
<div class="form">
  <div style="text-align: left; font: normal bold 14px arial; cursor: pointer" onclick="contactBox.hide();">X</div>
  <div style="padding-bottom: 10px;font-size: 14px; text-align: center"><%=msgs.getString("contactHeader")%></div>
  <form id="frmContact" onsubmit="try {sendContact();} catch (e) {console.log(e)} return …
Run Code Online (Sandbox Code Playgroud)

java jsp tomcat properties

1
推荐指数
1
解决办法
1万
查看次数

Windows关闭 - 关闭命令或ExitWindowsEx

我想知道当一个软件需要重启,关闭,注销或休眠Windows时,哪种方法最佳:

  1. 使用ExitWindowsEx API
  2. 使用Shutdown命令及其参数

每种方法的优点和缺点是什么?

谢谢

windows winapi shutdown

1
推荐指数
1
解决办法
920
查看次数