Html/Jsp常用的页面跳转方法
第一种:
<script language="javascript" type="text/javascript">
window.location.href="login.jsp?backurl="+window.location.href;
</script>
第二种:
<script language="javascript">
alert("返回");
window.history.back(-1);
</script>
第三种:
<script language="javascript">
window.navigate("top.jsp");
</script>
第四种:
<script language="JavaScript">
self.location="top.htm";
</script>
第五种:
<script language="javascript">
alert("非法访问!");
top.location="xx.jsp";
</script>
第六种:
servlet实现跳转-->request.getRequestDispatcher("/WEB-INF/pages/error.jsp").forward(request,response);
第七种:
由于以上的跳转都是webRoot下的,或者已知完整url地址的跳转.如果html或者jsp是存放在WEB-INF下的,在使用struts的情况下,可以通过配置struts的路径获得完整的url地址,不使用struts实现WEB-INF下的页面跳转...
/**
* @author Vicky
* @emial eclipser@163.com
*/
public class NavigateTo extends HttpServlet {
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
String url = request.getParameter("url");
request.getRequestDispatcher(url).forward(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
doGet(request, response);
}
}
web.xml配置:
<servlet>
<servlet-name>NavigateTo</servlet-name>
<servlet-class>cn.vicky.servlet.NavigateTo</servlet-class>
</servlet>
使用的页面:
<%
String path = request.getContextPath();
%>
<script type="text/javascript">
function playGame()
{
window.
相关文档:
// 抽象类 package com.albert.email.mime; import org.springframework.mail.javamail.JavaMailSender; public abstract class AbstractMessageSender {
protected String from;
protected String to;
protected String subject; ......
1.request对象
该对象封装了用户提交的信息,通过调用该对象的响应的方法可以获取用户提交的信息。
当request对象获取用户提交的汉字字符时,会产生乱码,由下面的方法可以解决:
Sting s2 = new String(s1.getBytes("iso8859-1"),"GB2312")进行转换。
request常用的方法 ......
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
Go
----截取字符串,并出去html
create FUNCTION [dbo].[CutString] (@str varchar(1000),@length int)
RETURNS varchar(1000) AS
BEGIN
declare @mainstr varchar(1000)
declare @substr varchar(1000)
if(@str is not null or @st ......
1.FCKeditor 介绍
FCKeditor 这个开源的HTML 文本编辑器可以让web 程序拥有如MS Word 这样强大的编辑功能,.FCKeditor 支持当前流行的浏览器。
2.准备工作:
环境:winddows XP、tomcat6.0、JDK1.6
下载:
1):FCKeditor_2.6.4.zip
地址:http://nchc.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.6.4.zip ......