JSP内建的9种对象

Posted by dohkoos on October 20th, 2007 (373 views)

page
application
request
response
session
config
out
pageContext

Related Posts

People who read this, also read...

关于定制的404页面被IE替代的问题的解决[zt]

Posted by dohkoos on September 14th, 2006 (410 views)

原文:http://www.blogjava.net/mstar/archive/2005/10/26/16907.html

在我现在做的项目中要指定自己的404,403等错误页面,但是由于这些页面的内容较少(小于512bytes,就会被IE认为是不友好的错误显示页面,而用自己的“友好的界面”代替)。郁闷了我好长时间,终于在一个台湾的论坛上找到了答案(感谢台湾的同行)。
把错误页面做成JSP,然后在里面加上

<% response.setStatus(200); %>

这样IE得到的消息就是这个Response是正常的,所以就不会用它的“友好的界面”了。这是在欺骗IE,呵呵。但是不知道有没有负面影响。
当然,你也可以让你的页面多一些废话,以便满足IE的长度要求。
哎~~,真不知道说IE什么好......

Related Posts

People who read this, also read...

JSP中怎样输出\r\n到textarea中

Posted by dohkoos on January 12th, 2005 (554 views)

test.jsp

<%
    String str = "aaaaaarnbbbbb";
%>

<body>
    <textarea id="editor" name="editor"></textarea>;
</body>

<script language="javascript">
<!–-
    var o = document.getElementById('editor');
    o.value = '<%= str.replaceAll("\r\n", "\\\\r\\\\n") %>';
//-–>
</script>

Related Posts

People who read this, also read...