小编new*_*bie的帖子

记录Google App Engine应用程序

我使用开发服务器制作了GAE应用程序,但现在当我将它部署到GAE云时,某些功能不起作用(某些元素缺失),但没有抛出异常.

现在我想对我的代码进行一些日志记录,这样我就可以找到为什么这些东西在开发环境中工作,但在GAE云中却没有,但是我没有找到一种记录事件的方法,就像我可以用开发一样Eclipse中的服务器.

那么可以像在Eclipse开发服务器中那样记录事件吗?

java google-app-engine

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

Guice就像PHP中的依赖注入框架一样

在PHP中是否有任何Guice或类似的依赖注入框架?如果不是PHP中有任何良好的依赖注入框架?

我必须在PHP中实现与Java相同的代码,并在Java项目中使用Guice.因此,如果它使用类似的框架,那么实现PHP版本会更容易.

php dependency-injection

17
推荐指数
2
解决办法
3805
查看次数

制作网络表单的最佳做法

是否可以使用表格来制作网页表格,还是应该使用div?我知道如何使用表格,但我应该如何使用div制作表格或者使用表格更好?

<form method="post">
    <table>
        <tr>
            <td>
                <label for="username">Username:</label>
            </td>
            <td>
                <input type="text" name="username" id="username"/>
            </td>
        </tr>
        <tr>
            <td>
                <label for="password">Password:</label>
            </td>
            <td>
                <input type="password" name="password" id="password"/>
            </td>
        </tr>
        <tr>
            <td>
                <input type="submit" name="cancel" value="Cancel"/>
            </td>       
            <td>
                <input type="submit" name="send" value="Send"/>
            </td>
        </tr>
    </table>
</form>
Run Code Online (Sandbox Code Playgroud)

可能重复: 为什么 - 不使用表格为布局在html中

html forms

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

如何使用EGit将当前Eclipse项目添加到git?

我在Eclipse中有GAE项目,我想将它添加到我当地的git repo中,我该怎么做?

eclipse git egit

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

具有多个实现的Guice和接口

如果我有接口Validator和这个接口的多个实现.如何使用Guice注入任何多个实现?现在我知道我可以使用以下代码注入一个,但它只允许一个实现:

public class MyModule extends AbstractModule {
  @Override 
  protected void configure() {
    bind(Validator.class).to(OneOfMyValidators.class);
  }
}
Run Code Online (Sandbox Code Playgroud)

我想做的是:

Validator v1 = injector.getInstance(Validator1.class);
Validator v2 = injector.getInstance(Validator2.class);
Run Code Online (Sandbox Code Playgroud)

有可能吗?

java guice

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

如何从web.xml中将所有错误捕获到同一页面?

我试着用

<error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/errors/error.jsp</location>  
</error-page> 
Run Code Online (Sandbox Code Playgroud)

但我没有抓到404错误.如何在同一页面上捕获404等错误?我想将所有错误代码捕获到相同的错误页面jsp.

java web.xml deployment-descriptor custom-error-pages

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

如何在Eclipse中使用Maven构建WAR?

我有一个项目,我现在开始作为Maven项目,但由于某种原因它不起作用.这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ProgramName</groupId>
    <artifactId>ProgramName</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.core</artifactId>
            <version>3.0.2.RELEASE</version>
        </dependency>

        <!-- all other dependecies here -->

    </dependencies>
    <build>
        <finalName>ProgramName</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <webResources>
                        <resource>
                            <targetPath>WEB-INF</targetPath>
                            <directory>src/main/webapp/WEB-INF</directory>
                            <filtering>true</filtering>
                            <includes>
                                <include>*.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.0</version>
            </plugin>
        </plugins>
    </build>
</project>
Run Code Online (Sandbox Code Playgroud)

java maven-2 web-applications

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

如何从Java中读取URL中的图像?

我在我的Web应用程序中有servlet提供图像,当我访问那些带有浏览器图像的URL时,服务器是正确的.然后我有另一个调整图像大小的servlet,想法是在resize servlet中通过url访问get图像,然后调整图像大小.但由于某种原因,以下所有方法都返回null,但是当我使用浏览器访问给定的URL时,图像显示正确.

    URL imageURL = new URL(fullUrl);
    // Case 1
    RenderedImage img = ImageIO.read(imageURL);

    // Case 2
    BufferedImage img = JAI.create("url", imageURL).getAsBufferedImage();

    // Case 3
    Image img = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(imageURL);
Run Code Online (Sandbox Code Playgroud)

java image

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

使用自定义注释扫描类路径以查找类

例如,如果我有注释@MyOwnAnnotation,并在我的类路径有这些类,这样我可以以某种过滤器的可能扫描classpath中(例如,仅扫描开始包my.own.app.*),并获得与注释的所有类的列表@MyOwnAnnotation?我使用guice作为注入框架,我不使用Spring.

java guice

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

是否有像MySQL工作台这样的SQL Server数据库设计软件?

我需要为SQL Server设计数据库,有没有类似软件的MySQL工作台呢?我可以访问MSDN,因此它也可以是可以从MSDN找到的商业产品.

sql-server database-design

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