分类: Java&Jsp预览模式: 普通 | 列表
08-05
27

Exception Processing ErrorPage[errorCode=404,location=*.jsp]

Exception Processing ErrorPage[errorCode=404,location=*.jsp]
java.net.SocketException: Connection reset by peer: socket write error
出现这样的错误源于web.xml的配置,起初配置的是:
        <error-page>
        <error-code>404</error-code>
        <location>/index.do</location>
        </error-page>


更改为文件名错误解除:

查看更多...

Tags: Exception TOMCAT

分类:Java&Jsp | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2100
08-04
30

更改tomcat默认首页的方法

     在webapps\ROOT下放置index.htm就可用执行,而index.jsp反而不执行,也有很多人在讨论这个问题。
解决方法如下:
     修改server.xml文件,在Host 里面的加入以下的代码:  

    <Context path="" docBase="C:\wwwroot\" workDir="C:\wwwroot\"  />


       其中path是为"", 不是"/" , docBase就是你放置网页的目录, workDir也是你放置网页的目录,并且这个参数必不可少,我在添加代码的时候没有添加这个参数,搞得不能运行.那么整体的代码如下:        

查看更多...

Tags: TOMCAT

分类:Java&Jsp | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1111
08-04
28

FCK配置及扩展攻略

    本文的主要的特点就是考虑到了两个平台:linux和windos;考虑了两个服务器:apache和resin。主要讲述了里面的配置方法和测试用例,并没有详细的讲述什么瘦身,什么其他安全配置等等。

    本文的修改针对的是resin3.0和apache2.2;windows xp(本机)和redhat AS4(具有特定配置的修改)。具体的配置方法如下:

1、安装包选择

本次配置中使用了FCKeditor2.6和FCKeditor.java 2.3。可以在http://www.fckeditor.net/download下载得到。

2、初步配置

查看更多...

Tags: FCK 配置 扩展

分类:Java&Jsp | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1024
08-04
18

请说出几种软件开发时的设计模式

策略模式
代理模式
抽象工厂模式
代理模式之动态代理
单态模式和简单工厂模式
工厂方法模式
建造模式
门面模式
....

Tags: 设计模式

分类:Java&Jsp | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 544
08-04
16

Two Servlet Filters Every Web Application Should Have

《每一个WEB应用程序,都应该有两个过滤器》by Jayson Falkner
原文如下:
Almost every single web application you will ever make will seriously benefit from using servlet filters to both cache and compress content. A caching filter optimizes the time it takes to send back a response from your web server, and a compression filter optimizes the size of the content that you send from your web server to a user via the Internet. Since generating content and sending content over the World Wide Web are the bread and butter of web applications, it should be no surprise that simple components that aid in these processes are incredibly useful. This article details the process of building and using a caching filter and a compression filter that are suitable for use with just about any web application. After reading this article, you will understand caching and compressing, have code to do both, and be able to apply caching and compression to any of your future (or existing!) web applications.

Review: Servlet Filters in 10 Sentences
Servlet filters are powerful tools that are available to web application developers using the Servlet 2.3 specification or above. Filters are designed to be able to manipulate a request or response (or both) that is sent to a web application, yet provide this functionality in a method that won't affect servlets and JSPs being used by the web application unless that is the desired effect. A good way to think of servlet filters is as a chain of steps that a request and response must go through before reaching a servlet, JSP, or static resource such as an HTML page in a web application. Figure 1 shows the commonly used illustration of this concept.


查看更多...

Tags: filter zip

分类:Java&Jsp | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 573
08-04
15

JAVA与WEB2.0亲密接触

     现在越来越多的网站应用都加入RSS或是ATOM这一类新功能,用户可以通过它更准确的订阅到自己想知道的信息,去掉大量的陈旧信息和无用的广告,信息比以往任何时候都要来得及时。而作为公司来说,统一的接口会使市场更加的规范,使得个人用户的选择更多,我们可以利用RSS来轻松的从一个BLOG搬家到另一个BLOG。这也让我们看到了,WEB2.0这一理念越来越被广泛应用。
   由于开源产业的不规范性,出现了RSS与ATOM两类格式的XML文本。虽然newsfeed这种新型的新闻供应机制存在种种质疑,但newsfeed的潜力是有目共睹,势不可挡。不管在将来谁会取代谁,作为我们程序员来说也应尽快尽可能全面的了解此类新技术。而国内JSP方面对于此技术的关注实在少得可怜。资料也甚是难找。
   下面本站将介绍用JAVA如何来生成RSS&ATOM.XML
     这里我们用到了SUN公司开发的ROME.jar做这一系列事情。

先制作一个接口类及其抽象方法
import java.util.Collection;
import java.util.Date;

查看更多...

Tags: ROME ATOM RSS WEB2.0

分类:Java&Jsp | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 498