选择复选框数据表primefaces上的行选择

我们需要在复选框的切换时在行选择上触发ajax事件。我试图找到示例,但他们只是在点击p:命令按钮时进行行选择。我们正在使用primefaces 2.2 码 <!– –>

如何从URL中提取参数,无论其编写方式如何?

我想要一种java方法来提取URL的参数,无论这些参数是如何写入其中的,都是常规方式,如( https://www.facebook.com/Doly.mohamed.Smile9?ref=stream&hc_location=stream )这很简单,因为我所要做的就是: URL url = new URL(“www.blabla….etc”); String query = url.getQuery(); try{ String [] params = query.split(“&”); for(int i= 0 ; i < params.length; i++){ String [] split = params[i].split("="); parameters.put(split[0], split[1]); } }catch(NullPointerException ex){} 所以参数值是: key = ref value = stream , key = hc_location value = stream 但是,如果URL具有以其他方式编写的参数,或者如果URL没有像doPost()方式那样在其中写入参数,我该怎么办? 有没有办法从URL获取extraPathInfo而不使用servlet?

迭代嵌套映射

我有一个嵌套的hashmap(hashmap中的Hashmap)。 Map<String,Map> test = new HashMap<String,Map>(); Map testMp = new HashMap(); testMp.put(“1”, “Key1”); testMp.put(“2”, “Key2”); testMp.put(“3”, “Key3”); testMp.put(“4”, “Key4”); testMp.put(“5”, “Key4”); test.put(“One”, testMp); 理想情况下,如果我需要在测试图中打印键和值,我会这样做 – for(Map.Entry<String, Map> t:test.entrySet()) { System.out.println(“KEY: ” +t.getKey()+ ” VALUE:” +t.getValue()); } 但我也想要内部地图的关键和价值。 我想要这样的东西 – Key of outermap Key of innermap, and its value.

在hashmap中读取excel文件时for循环出错

我试图在hashmap中访问excel文件,但是i = 5 colNum得到8,所以输出没有按预期得到。 下面是代码使用hashmap读取此excel文件,一旦questionType匹配,我想只存储相应的标签和值,然后传递给相应的类 public class HashMapObjectTest { static HSSFSheet sheet; static HSSFRow row; private static MissingCellPolicy xRow; static DataFormatter df = new DataFormatter(); @Test public void getMapData() throws Exception { File src=new File(“D:\\Projects\\TestData_peerTest.xls”); FileInputStream fis=new FileInputStream(src); HSSFWorkbook wb=new HSSFWorkbook(fis); sheet = wb.getSheetAt(0); DataFormatter df = new DataFormatter(); Row row; //String value1 = null; […]

org.apache.commons.dbcp.DelegatingPreparedStatement已关闭

org.apache.commons.dbcp.DelegatingPreparedStatement已关闭 我能知道这种情况会发生在哪种情况下。 我关闭了所有结果集和准备好的语句。 我怎么解决这个问题。 代码: public int UpdateMovementLines(List mlinelist,String projId,String documentno,String user){ int count = 1; int line = 0; String uom = null; String projLocatorId = null; String projWarehouseId = null; String warehouseLocatorId = null; String issuanceId = null; String movementLineId =null; String pinstanceId = null; String sqlQry = null; String whLocatorId = null; […]

数字系统类的inheritance层次结构

对于数学表达式的符号表示,我试图构建数字系统类的层次结构。 除了Integer和Real ,我还需要像Rational和Complex这样的类。 我希望所有这些类能够相互无缝地互操作。 例如,将Complex添加到Integer将给出Complex等。 我让所有这些都实现了Number接口。 (不是java.lang.Number ) 为了能够添加不同类型的数量,我尝试制作如下的层次结构。 Integer扩展Rational扩展Real扩展Complex 这使得Integer不必要地存储虚部等。这种开销是不希望的。 允许访问Integer虚部也似乎是不合适的。 任何人都可以建议一个更好的设计,避免开销,仍然可以进行互操作吗?

无法分配最终的局部变量,因为它是在封闭类型中定义的?

期望能够在最后创建一个具有Time和Cost值的变量,我将最终在TextView中显示。 尽管遇到了我的问题。 public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final int intTime = 30; final int intCost = 10; CheckBox CP = (CheckBox)findViewById(R.id.checkPepperoni); CheckBox CS = (CheckBox)findViewById(R.id.checkSausage); CheckBox CB = (CheckBox)findViewById(R.id.checkBacon); CheckBox CM = (CheckBox)findViewById(R.id.checkMushroom); final ImageView cheese =(ImageView)findViewById(R.id.imgCheese); final ImageView pepperoni =(ImageView)findViewById(R.id.imgPepperoni); […]

已建立大气sockets但未接收/发送数据

我正在关注Atmosphere 教程以获得基本的聊天应用程序设置。 目前,当运行javascript时,它似乎能够使用Web套接字建立与服务器的连接。 我在Chrome控制台中获得以下内容: Invoking executeWebSocket core.js:2298 Using URL: ws://localhost:8080/web-transport/chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.1&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json core.js:2298 Websocket successfully opened 但是,当我尝试发布数据(subSocket.push(…))时似乎没有任何事情发生。 我已经尝试调试AtmosphereHandlerService但它似乎永远不会被命中(并且没有生成日志。 我错过了什么会导致这种情况? 到目前为止,我有以下内容: web.xml中 AtmosphereServlet AtmosphereServlet AtmosphereServlet AtmosphereServlet org.atmosphere.cpr.AtmosphereServlet <!– true –> AtmosphereServlet /chat/* ChatAtmosphereHandler.java @AtmosphereHandlerService(path = “/chat”) public class ChatAtmosphereHandler implements AtmosphereHandler { public void onRequest(AtmosphereResource resource) throws IOException { AtmosphereRequest request = resource.getRequest(); if (request.getMethod().equalsIgnoreCase(“GET”)) { resource.suspend(); } […]

如何使用doSecondPassexception解决jpa和hibernate一对一注释

您好我正在编写简单的代码,使用jpa和Hibernate 3.2版本将数据插入到两个表中。我的意图是将Employee详细信息保存在两个表中,即Employee包含employeeId,这是主键,手动分配指定值和Employee Address共享使用@onetoOne annotions的Employee表中的主键employeeId。我的类就像lool一样 @Entity @Table(name = “employee”, catalog = “test”, uniqueConstraints = {}) public class Employee implements java.io.Serializable { // Fields private Integer employeeid; private String name; private Employeeaddress employeeaddress; // Constructors /** default constructor */ public Employee() { } /** minimal constructor */ public Employee(Integer employeeid) { this.employeeid = employeeid; } /** full […]

是否有关于servlet的会话完整性的正式定义?

这个问题与另一个现有的SO问题有关 。 HttpServletRequest的getSession(boolean)方法提到会话完整性,但它没有定义概念。 我找不到一个正式的定义。 有没有? 有没有人知道会话进入或退出完整性时正式定义的规则? 谢谢。