小编Dmi*_*edv的帖子

正则表达式在页面上找到两个单词

我正在尝试查找包含单词"text1"和"text2"的所有页面.我的正则表达式:

text1(.|\n)*text2 
Run Code Online (Sandbox Code Playgroud)

它不起作用.. 在此输入图像描述

regex intellij-idea

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

jQuery的最接近在IE8/9中不起作用

我有这个jQuery代码:

$(this).closest('div:has(.FIND_ME)').find('.FIND_ME').hide();
Run Code Online (Sandbox Code Playgroud)

但是带有类的元素.FIND_ME并不隐藏在IE8和9中.

此问题是搜索具有共同祖先的项目的延续

HTML:

<div>
    <div><!-- all div without ID -->
        <span>some text</span>
        <div>
          <span id="listener1">click here</span>
          <span>sometext</span></div>
        <div>

        <span class="FIND_ME">Result Here</span></div>
    </div>

    <div>
        <span>some text</span>
        <div id="div1">
         <div id="div2">
          <span id="listener2">click here</span>
          <span>sometext</span></div>
         </div>
        <div>

        <span class="FIND_ME">Result Here</span></div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

javascript jquery internet-explorer-8

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

IntelliJ IDEA:在打开的文件中搜索

有时我们需要在IntelliJ IDEA中搜索已打开的文件. 例如: 通常我有大量打开的文件,手动搜索需要花费很多时间(每个html文件中都有Ctrl + F).
class="redtext"

更快的方法吗?

intellij-idea intellij-14

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

String vs StringBuffer.IDEA的提示

Intellij Idea提供更换以下内容:

StringBuffer sb = new StringBuffer();
sb.append("Name=").append(name).append(", name2=").append(name2).append(", list=").append(list);
return sb.toString();
Run Code Online (Sandbox Code Playgroud)

至:

return "name=" + name + ", name2=" + name2 + ", list=" + list;
Run Code Online (Sandbox Code Playgroud)

据我所知,它不太有效(可变/不可变).那么,更好的是什么?

java performance intellij-idea stringbuffer

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

Spring MVC.HTTP状态404

我开始从这门课程中学习"Spring MVC":http://www.pluralsight.com/training/Courses/TableOfContents/springmvc-intro 在步骤"Building-> Run the Application"中,我被困住了.

当我尝试去链接时,http://localhost:8080/FitnessTracker/greeting.html 我得到"HTTP状态404"

HTTP Status 404 - /FitnessTracker/WEB-INF/jsp/Hello.jsp
type Status report
message /FitnessTracker/WEB-INF/jsp/Hello.jsp
description The requested resource is not available.
Apache Tomcat/7.0.50
Run Code Online (Sandbox Code Playgroud)

web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
  <servlet>
    <servlet-name>fitTrackerServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/config/servlet-config.xml</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>fitTrackerServlet</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>

  <display-name>Archetype Created Web Application</display-name>
</web-app>
Run Code Online (Sandbox Code Playgroud)

的servlet-config.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:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">

  <mvc:annotation-driven />
  <context:component-scan base-package="com.pluralsight.controller"></context:component-scan>

  <!--
  <bean …
Run Code Online (Sandbox Code Playgroud)

java model-view-controller spring jsp spring-mvc

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