JSP中与路径相关的常用的几个方法
http:/localhost/123/jsp/test.jsp:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />
<title>test.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css" mce_href="styles.css">
-->
</head>
<body>
<p>
<h2>application - javax.servlet.ServletContext</h2>
application.getRealPath("/")<%=application.getRealPath("/") %><br>
application.getMajorVersion() - <%=application.getMajorVersion() %><br>
application.getMimeType("txt") - <%=application.getMimeType("txt") %><br>
application.getServerInfo() - <%=application.getServerInfo() %><br>
application.getServletContextName() - <%=application.getServletContextName() %><br>
application.getContext()
</p>
<p>
<h2>config - javax.servlet.ServletConfig</h2>
config.getServletName() - <%=config.getServletName() %><br>
config.getServletContext()<br>
</p>
<p>
<h2>pageContext - javax.servlet.jsp.PageContext</h2>
pageContext.getRequest()(JSP中的requset隐式对象)<b
相关文档:
FCKeditor jsp 配置 使用
2009-04-07 16:57
FCKeditor是一款跨平台的在线编辑器,到我发布本文,FCKeditor的官方版本已经发展到了2.6.4
点击进入 官网
1、首先登陆www.fckeditor.net/download下载FCKeditor的最新版本,需要下载2个压缩包,一个是基本应用,另一个是在为在jsp下所准备的配置。
  ......
建立条件首先一定要确定自己的mysql,tomcat,eclipse连接是正确的。
index.jsp很简单,就一个跳转。
<%
response.sendRedirect("lg.jsp");
%>
lg.jsp 实现登录框架
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<title>
login
</title>
</hea ......
index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......
1.No getter method for property name problem(struts)
有一种可能是Bean没有写相应的get方法,例如变量userName的get方法是getUserName;
还有就是这个Bean为空;
2.
MyEclipse的自动添加struts和hibernate功能不能返回,请注意!
所以我先使用MyEclipse导入struts和hibernate,然后将它们的jar导入到另外一个新建的 ......
在访问JSP文件或者Servlet的时候,如果提示下载并保存,如下图所示:
同样的程序有的浏览器出错,有的浏览器不出错。错误的原因是设置MIME类型的代码有误。
如果是JSP文件,查看文件头:
<%@ page contentType="text/html;charset=gb2312"%>
如果是Servlet文件,查看:
response.setContentType("text/html;char ......