小编Har*_*til的帖子

GAE/GWT:加载模块时出错:无法找到'com/androidstartup/serialization/KPadProject.gwt.xml'

我使用Eclipse 3.5与GAE SDK 1.3.7和GWT SDK 2.1.0和Restlet 2.0.3.当我运行我的应用程序时,控制台日志显示:

Loading modules
   com.androidstartup.serialization.KPadProject
      [ERROR] Unable to find 'com/androidstartup/serialization/KPadProject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doSlowStartup method
Run Code Online (Sandbox Code Playgroud)

主模块/KPadProject.gwt.xml位于根包中.我检查了配置,我认为没问题.

此时我不知道如何解决这个问题.

gwt google-app-engine module restlet gae-module

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

jquery滑动侧栏从左到右

我正在尝试创建一个具有类似效果的滑动侧栏

  1. www.wookmark.com
  2. http://www.dynamicdrive.com/dynamicindex1/slideinmenu.htm.

这是我写代码的距离.但这是生涩的.

  1. 任何人都可以提出更好的解决方案与aniamtions/easing/toggle等
  2. 我希望代码独立于左参数,即$("#slide").css("left"," - 150px"); 它应该能够以各种div宽度滑入/滑出

有任何想法吗 ?

CSS

#slide{
border:1.5px solid black;
position:absolute;
top:0;
left:0;
width:150px;
height:100%;
background-color:#F2F2F2;
layer-background-color:#F2F2F2;
}
Run Code Online (Sandbox Code Playgroud)

HTML

<div id="slide" style="left: -150px; top: 0px; width: 160px;">
    <p>Something here</p>
</div>
Run Code Online (Sandbox Code Playgroud)

jQuery的

<script>
    jQuery(document).ready(function() {
        $('#slide').mouseover(function() {
            $("#slide").css("left", "0px");
        });

        $('#slide').mouseout(function() {
            $("#slide").css("left", "-150px");
        });

    });
 </script>
Run Code Online (Sandbox Code Playgroud)

html jquery sidebar slidetoggle

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

Spring MVC - 将枚举填充到下拉列表中

我有一个这样的表格:

<form:form method="POST" action="searchProjects" commandName="projectcriteria">
    <table>
        <tr>
            <td class="label"><spring:message code="number" /></td>
            <td><form:input path="number" /></td>
            <td class="label"><spring:message code="customer" /></td>
            <td><form:input path="customer" /></td>
        </tr>
        <tr>
            <td class="label"><spring:message code="name" /></td>
            <td><form:input path="name" /></td>
            <td class="label"><spring:message code="status" /></td>
            <td>
                <form:select path="status">
                    <option value=""><spring:message code="please_select" /></option>
                    <c:forEach var="enum" items="${allStatus}">
                        <option value="${enum}"><spring:message code="${enum.statusEnum}" /></option>
                    </c:forEach>
                </form:select>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: center;">
                <input type="submit" value="<spring:message code="search"/>" />
                <input type="button" value="<spring:message code="reset_criteria"/>" />     
            </td>
        </tr>
    </table>
</form:form>
Run Code Online (Sandbox Code Playgroud)

Projectcriteria和StatusEnum是这样的:

public enum StatusEnum {
    INV("Invalidate"),
    TOV("Validate"),
    VAL("Validated"),
    FIN("Finished"); …
Run Code Online (Sandbox Code Playgroud)

forms enums spring jstl spring-mvc

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

使用 JAXB 从未编组的 java 对象中获取 xml 元素名称

我的 Java 模型中有带有注释的字段@XmlElement(name="xxx")

有没有办法以编程方式获取 xml 元素名称?

java xml jaxb

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

Hadoop mapReduce 如何仅在 HDFS 中存储值

我正在使用它来删除重复行

public class DLines
 {
   public static class TokenCounterMapper extends Mapper<Object, Text, Text, IntWritable>
    {
    private final static IntWritable one = new IntWritable(1);
      private Text word = new Text();
      @Override
      public void map(Object key, Text value, Context context) throws IOException, InterruptedException
       {
           String line=value.toString();
           //int hash_code=line.hashCode();
           context.write(value, one);
       }
   }

public static class TokenCounterReducer extends Reducer<Text, IntWritable, Text, IntWritable> 
 {
        @Override
    public void reduce(Text key, Iterable<IntWritable> values, Context context)throws IOException, InterruptedException 
     {
 public void reduce(Text key, Iterable<IntWritable> values, Context context)throws …
Run Code Online (Sandbox Code Playgroud)

java hadoop mapreduce

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

使用jQuery选择动态创建的元素

试图找出这个,我想我知道问题,但我不知道如何解决它.当我的页面首次加载时,我正在使用JSON文件在页面上提供一些链接,使用$ .getJSON创建它们并动态地为它们提供ID.我的代码是(这只是我现在感兴趣的一点,我当然关闭了这个函数):

    $(function() {

        $.getJSON("data.json", function(data) {
            var navOutput = "";
            for (var key in data.navigation) {
                navOutput += '<li><a id="' + key + '">' + data.navigation[key] + '</a></li>'; // Create list items with ID 'key'
            }
            $("#mainNav").html(navOutput);
Run Code Online (Sandbox Code Playgroud)

页面上的所有内容都很好.在$ .getJSON函数之外,我试图将事件侦听器分配给其中一个动态创建的ID,作为示例:

$("#cast").click(function() {
    alert("Testing");
}); //click function
Run Code Online (Sandbox Code Playgroud)

这似乎不起作用.可能有一个简单的答案,但我无法弄清楚.如果我将事件处理程序分配给在HTML中创建的页面上的ID,它就可以工作,因此它与这些动态ID有关.任何帮助,将不胜感激.

html jquery getjson

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

我们可以用模式验证@RequestParam值吗

我有一个要求,在哪里我需要验证我的身份@RequestParam,使其与我的模式匹配

范例:

 @RequestMapping(value = "/someTest")
  public Object sendWishes(@RequestParam("birthDate") String birthDate)

    {
      // i need birthDate to be a valid date format in YYYYMMDD format
      // if its not valid it should not hit this method
    }
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc

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

xml conditional code in log4j2.xml

I'm trying to create a conditional statement in my log4j2.xml file and it does not seem to accept any of the conditional formatting. I've tried various options such as xslt etc. and it doesn't seem to work. Any help here would be great.

My intention is to create separate paths for logging, based on the operating system. I see that the appender error is because the MyRollingLog value has not be set. However it's the CLASS_NOT_FOUND error that I'm not …

xml xslt log4j2

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

如何返回AJAX查询的纯文本?

我基于这个Crunchify教程了解如何做到这一点.

我有一个单页面的应用程序.

它有两个功能.它需要向HTTP servlet发送请求,该servlet将调用自己的java,并从中接收包含任何错误的JSON字符串/建议servlet接下来要做什么.

另一个功能是它从servlet中提示保存文件对话框.

问题是 - 我如何构建我的servlet,以便它返回一个纯文本HTTP响应,以便检查AJAX查询.

我有一个很好的方法来做这个,我想建议如何以更简单的方式实现同​​样的事情.

web.xml中

   <servlet>
        <servlet-name>MyServlet</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>MyServlet</servlet-name>
        <url-pattern>/submitQuery</url-pattern>     
          <url-pattern>/saveFile
    </servlet-mapping>
Run Code Online (Sandbox Code Playgroud)

MyServlet-servlet.xml中

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <context:component-scan base-package="world.hello.myservlets" />

    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass"
            value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/WEB-INF/jsp/" />
        <property name="suffix" value=".jsp" />
    </bean>
</beans>
Run Code Online (Sandbox Code Playgroud)

MyServlet.java

package world.hello.myservlets;

@Controller
public class MyServlet{


    @RequestMapping("/submitQuery")
    public ModelAndView submitQuery()
    {       

        return new ModelAndView("text", "model", "hello world");
    }

}
Run Code Online (Sandbox Code Playgroud)

/WEB-INF/jsp/text.jsp …

ajax spring servlets spring-mvc single-page-application

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

JPA/JTA/@Transactional Spring注释

我正在阅读使用Spring框架的事务管理.在第一个组合中,我使用Spring + hiberante并使用Hibernate的API来控制事务(Hibenate API).接下来,我想使用@Transactional注释进行测试,它确实有效.

我对此感到困惑:

  1. JPA,JTA,Hibernate是否有自己的"事务管理"方式.举个例子,考虑一下我是否使用Spring + Hibernate,那么你会使用"JPA"事务吗?

    就像我们有JTA一样,我们可以使用Spring和JTA来控制交易吗?

  2. @Transactional注释,是特定于Spring框架是什么?根据我的理解,这个注释是特定于Spring Framework的.如果这是正确的,@Transactional使用JPA/JTA进行事务控制?

我在网上阅读以清除我的怀疑,但是我没有直接回答.任何输入都会有很大的帮助.

spring annotations hibernate jpa spring-mvc

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