问题列表 - 第41357页

spring mvc如何绕过DispatcherServlet获取*.html文件?

web.xml片段

<!-- Handles all requests into the application -->
<servlet>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/app-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)

它工作正常,但我不想让Dispatcher Servlet处理*.html请求.我如何做到这一点?谢谢.

web.xml servlets spring-mvc

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

stringstream的大小

有没有直接的方法来计算stringstream中内部字符串的大小?

在这里,str()返回一个副本然后它获得字符串的大小.

std::stringstream oss("String");
oss.str().size();
Run Code Online (Sandbox Code Playgroud)

c++

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

Makefile可以确定使用gcc哪些标题丢失?

我有一个简单的库为我生成标题,我希望在Makefile中将它链接在一起.

如果cpp文件包含不存在的头文件,它应该从匹配的源文件生成它(如果相应的文件存在).我无法弄清楚如何做到这一点.

我已经尝试使用gcc -MM提前找出每个.cpp文件的依赖关系,但如果缺少标头,则会失败.我需要知道哪些文件丢失以尝试重新生成它们.

如果我只是定义了一个标题prequisite所有.cpp文件,它总是会重新编译所有的,当然我的.cpp文件.

有关如何重新生成缺少的标头的任何想法?

build-automation dependencies code-generation makefile

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

使用API​​的TrueCrypt替代方案

我正在寻找一个TrueCrypt备选方案,它具有以编程方式访问文件的API.有谁知道解决方案?

API应支持列出,创建,更改和删除文件.

security encryption administration truecrypt

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

TemplateDoesNotExist 位于 /admin/admin/index.html

我无法使用 django 1.1.1 访问管理界面localloop:8000/admin。它在 Ubuntu 8.4 上运行良好,然后我升级到 Ubuntu 10.10 并且出现了问题。

settings.py我有:

import os.path
PROJECT_DIR=os.path.dirname(__file__)

TEMPLATE_DIRS =(os.path.join(PROJECT_DIR,'templates'))
Run Code Online (Sandbox Code Playgroud)

这在 Ubuntu 8.04 上运行良好,但在 Ubuntu 10.10 中不起作用。

关于出了什么问题的任何想法?这是回溯:

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.1.1
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'hotweb.accounts',
 'django.contrib.flatpages',
 'messages',
 'hotweb.jchat']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'django.middleware.http.SetRemoteAddrFromForwardedFor')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.load_template_source:
/home/scorpion/Desktop/hotweb/templates/admin/index.html (File does not exist)
Using loader …
Run Code Online (Sandbox Code Playgroud)

django django-templates

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

对于Loop和Lexically Scoped变量

版本#1

use warnings;
use strict;

my $count = 4;

for $count (1..8) {
    print "Count = $count\n";
    last if ($count == 6);
}

if (not defined($count)) {
    print "Count not defined\n";
}
else {
    print "Count = $count\n";
}
Run Code Online (Sandbox Code Playgroud)

这打印:

1
2
3
4
5
6
4
Run Code Online (Sandbox Code Playgroud)

为什么?因为for循环$count在其块内创建了自己的词法范围版本.

版本#2

use warnings;
use strict;

my $count;
for $count (1..8) {
    print "Count = $count\n";
    last if ($count == 6);
}

if (not defined($count)) {
    print "Count not …
Run Code Online (Sandbox Code Playgroud)

perl

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

实现单表继承后损坏的Rails路由

我已经为person类实现了单表继承

class Person < ActiveRecord::Base

end


class Teacher < Person

end

class Student < Person

end

class Outsider < Person

end
Run Code Online (Sandbox Code Playgroud)

而创建人似乎根据form.select中选择的内容创建了Teacher,Student或Person,并添加了type属性.

但是,我似乎打破了路线

<%= link_to'Edit',edit_person_path(@deal)%> | <%= link_to'Back',persons_path%>

它们似乎指向teacher_path,student_path和outsider_path而不是person_path.

路线需要做哪些改变?

ruby routing ruby-on-rails single-table-inheritance ruby-on-rails-3

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

如何将键盘箭头与jCarousel集成 - 使用Keynav jQuery插件?

好的.我的想法是我有一个jCarousel列表,每个视图显示3个项目.我正在使用jQuery Keynav插件通过键盘箭头键导航元素.

现在,当我(通过键盘箭头)导航到实际隐藏在轮播中的项目时,jCarousel必须滑动到新视图.

有没有可能做到这一点?或者是否有任何其他插件-say Keynav插件 - 支持触发事件以及按键?

这是一个实例http://www.jsfiddle.net/F4GCc/5/ (You'll have to actually click in the "Result" pane for the keyboard arrow navigation to work.)

javascript jquery jcarousel

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

带有iOS 4.2.1的越狱iPhone 3G无法使用XCode进行调试

我正在尝试使用XCode 3.2.5调试我的应用程序,并使用iOS 4.2.1越狱iPhone 3G.

当我使用启用的断点启动调试,应用程序无法启动(它停留在'Default.png'屏幕上)并且我使数据格式化程序暂时不可用,将在'继续'之后重新尝试.(无法在GDB中找到dlopen函数,因此无法加载共享库.)消息.

当我在没有启用断点的情况下启动调试时,应用程序启动没有问

我试着做那里描述的步骤,但没有任何结果.

当我使用iOS 4.1时,重启时出现问题.

在iPhone Organizer的每个连接上显示以下消息:

**Unknown iOS detected** Xcode does not have debugging information for the version of iOS on the device named “iPhone”. Xcode can collect debugging data from the device to enable development with this version of iOS. This process only needs to be done once per iOS version, and will take several minutes. …

iphone xcode

3
推荐指数
2
解决办法
6946
查看次数

SoftKeyboard隐藏EditText

我有一个布局,使用EditText让用户搜索数据库并填充ListView.EditText大约是屏幕顶部的2/3(位于ImageView上方,后面是一些介绍文本.)

问题是软键盘隐藏了EditText,因此用户无法看到他正在键入的内容.(我禁用了自动建议.)

我已经尝试过LinearLayout,RelativeLayout,paddings和不同的对齐/居中,但我仍然无法让它正常工作.EditText要么隐藏,要么被推离屏幕顶部,要么"压扁"并扭曲.

建议???

一种可能的解决方法是将EditText移动到屏幕顶部.但是,这与我给出的图形设计不同.

另一种可能的解决方法是让我在全屏幕上打开软键盘(不过如何确定).这仍然会隐藏EditText,但之后我可以重新启用自动建议,这样用户就可以看到他正在输入的内容......有点......因为他只能看到他正在输入内容的建议.

这是我最近的尝试.请参阅"introFrame".

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="wrap_content" 
 android:layout_height="fill_parent"
 android:orientation="vertical">

 <LinearLayout android:id="@+id/titleContainer"
  android:orientation="horizontal" android:layout_width="fill_parent"
  android:layout_height="wrap_content">
  <TextView android:text="@string/title_string"
   android:textSize="15sp" android:textColor="#FFFFFF"
   android:textStyle="bold" android:paddingLeft="5dp"
   android:layout_height="fill_parent" android:layout_width="wrap_content" />
 </LinearLayout>

 <FrameLayout 
 android:id="@+id/introFrame"
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content"
 android:gravity="center_horizontal" >
 <ImageView 
  android:src="@drawable/main_search_image"
  android:scaleType="center"
  android:layout_gravity="center"
  android:layout_height="wrap_content"
  android:layout_width="wrap_content"/>
 <LinearLayout
  android:orientation="vertical"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_gravity="center"
  android:paddingTop="140dp" >
  <LinearLayout android:id="@+id/introSearchContainer"
   android:orientation="horizontal" 
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_gravity="center_vertical" >
   <LinearLayout 
    android:orientation="horizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1" >
    <EditText android:id="@+id/intro_search_box" 
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:hint="     Enter keyword     " 
     android:imeOptions="actionGo"   
     android:inputType="textFilter" 
     android:maxLines="1" />
   </LinearLayout>
   <LinearLayout 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android android-softkeyboard android-edittext

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