JSP写文件代码
<%@ page contentType="text/html; charset=gbk" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></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">
-->
<link href="css/common_1.css" rel="stylesheet" type="text/css" />
<link rel="SHORTCUT ICON" href="../favicon.ico" />
<style type="text/css">
<!--
.STYLE2 {font-size: 12px}
-->
</style>
</head>
<body>
<%
String path_in = "";
String content = "";
path_in = request.getRealPath("/")+"admin"+File.separator+"manage_customer_details_edit.jsp";
try
{
PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter
(path_in)));
writer.println(
"<%"
+"@ page contentType=\"text/html; charset=gbk\" language=\"java\" import=\"java.sql.*\" errorPage=\"\" %"
+">");
writer.println("<%"+"@ page import=\"cn.com.cxweb.pc.db.databean\" %"+">");
writer.println("<%"+"@include file=\"const.jsp\"%"+">");
相关文档:
我们的开发方式是由demo人员完成系统的静态页面,并通过css进行美化。
为最大可能利用美工完成的静态页面,我们需要尽量减少对原html的冲击,因此我首先想到的Freemarker。
但是Freemarker最终让我空喜一场,最终自定义了一个可以递归嵌套的jsp tag来达到这个目的。
下面是解决这个问题的过程:
用css模版sdmen ......
在我们装好MyEclipse时,有时双击打开jsp页面,
会提示错误,无法显示页面.
因此要将jsp的默认打开方式改成代码试图:
办法:在菜单栏的
1.window—->perferences—–>General——->editors——>file associations
2.选择jsp——->选择相应的editor 为def ......
运行自己配置的web应用,往往只能看见weblogic编译之后的class文件。而看不见编译前的java的文件。为了调试方便,我们有时候是想看编译前的java文件。
在weblogic.xml中加入
<jsp-descriptor>
<jsp-param>
<param-name>keepgenerated</param-name>
<param-value>true</par ......
有两种传参方式
一、get方式:
这种方式将参数写在url中,举例来说,如果目标传参页面是target.jsp,那么在url里可以这么写:
http://..../target.jsp? <Param1> = <value1> & <Param2> = <value2> &...
&n ......
<%@ page contentType="text/html; charset=gbk" language="java" import="java.io.*" buffer="64kb" %>
<%
String path_in = "";
String content = "";
path_in = request.getRealPath("/")+"admin"+File.separator+ ......