显示页面:
<script type="text/javascript">
function subchk() {
document.form1.content.value = document.frames("myiframe").document
.frames("editor_body_area").document.documentEllement.outeHTML;
}
</script>
<body>
<div >
<form name="form1" onSubmit="subchk()" action="upNewsResult.jsp" method="post">
<table align="center">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><p>请输入标题:
<input name="editName" type="text" size="50">
<input name="submit"
type="submit" value="提交">
</p> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" width="626"><iframe id="myiframe"
src="/JPKC/editor/editor.htm?id=content&ReadCookie=0" frameborder="0"
scrolling="no" width="625" height="460"></iframe>
<textarea
name="content" id="content" cols="80" rows="2" style="display:none"></textarea></td>
</tr>
</table></form>
</div>
</body>
接受页面:<%
String name=new String(request.getParameter("editName").getBytes("iso_8859-1"));
String contents=new String(request.getParameter("content").getBytes("iso_8859-1"));
//String tname=session.getAttribute("tname").toString();
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd HH:ss");
String dt = simpledateformat.format(new Date());
String insertsql="INSERT INTO tb_newsinfo( title, content, addtime) VALUES(?,? ,?) ";
Connection conn=DBConnnection.getConnection();
try {
PreparedStatement stm=conn.prepareStatement(insertsql);
stm.setString(1,name);
stm.setString(2,contents);
stm.setString(3,dt);
int t=stm.executeUpdate();
if(t>0)
{
%>
"发布成功!"
<%
}
else{
%>
"发布失败!"
<%
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
%>
"公告发布失败!"
<%
}
conn.close();
%>出错:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).
<script type="text/javascript">
function subchk() {
document.form1.content.value = document.frames("myiframe").document
.frames("editor_body_area").document.documentEllement.outeHTML;
}
</script>
<body>
<div >
<form name="form1" onSubmit="subchk()" action="upNewsResult.jsp" method="post">
<table align="center">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><p>请输入标题:
<input name="editName" type="text" size="50">
<input name="submit"
type="submit" value="提交">
</p> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" width="626"><iframe id="myiframe"
src="/JPKC/editor/editor.htm?id=content&ReadCookie=0" frameborder="0"
scrolling="no" width="625" height="460"></iframe>
<textarea
name="content" id="content" cols="80" rows="2" style="display:none"></textarea></td>
</tr>
</table></form>
</div>
</body>
接受页面:<%
String name=new String(request.getParameter("editName").getBytes("iso_8859-1"));
String contents=new String(request.getParameter("content").getBytes("iso_8859-1"));
//String tname=session.getAttribute("tname").toString();
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd HH:ss");
String dt = simpledateformat.format(new Date());
String insertsql="INSERT INTO tb_newsinfo( title, content, addtime) VALUES(?,? ,?) ";
Connection conn=DBConnnection.getConnection();
try {
PreparedStatement stm=conn.prepareStatement(insertsql);
stm.setString(1,name);
stm.setString(2,contents);
stm.setString(3,dt);
int t=stm.executeUpdate();
if(t>0)
{
%>
"发布成功!"
<%
}
else{
%>
"发布失败!"
<%
}
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
%>
"公告发布失败!"
<%
}
conn.close();
%>出错:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).
解决方案 »
- springmvc + mybatis动态数据源切换问题
- 急!!!!!tomcat和websphere 6.1.0.0为啥部署的应用sessionId不一样?急!!!!!
- JAVA 菜鸟求教!我怎么把多一对多的客服端通信改成广播通信,而不是只是和服务端的交互!
- 如何通过编程的方法生成SOAP请求(根据WSDL)?
- 那天面了一道java排列数字组合面试题
- jsp 中用什么方法读取远程xml的属性
- 我要用JDBC把整个数据库的表复制到另一个数据库中去
- Apatch 与 Tomcat整合,根目录作为Webmodule 可以吗?
- java中的socket传文件的问题
- 关于tomcat启动的疑问,急切等待中......
- Spring 最常用的版本
- 这个中文乱码怎么回事?
DriverMamnager.getConnection()
这个函数的内容最好也帖出来
要转成gbk的字符
<td colspan="2" width="626"><iframe id="myiframe"
src="/JPKC/editor/editor.htm?id=content&ReadCookie=0" frameborder="0"
scrolling="no" width="625" height="460"></iframe>
<textarea
name="content" id="content" cols="80" rows="2" style="display:none"></textarea></td>
接收页面:
String contents=new String(request.getParameter("content").getBytes("iso_8859-1")); contents中没有内容!
URIEncoding="UTF-8"web乱码
http://blog.csdn.net/crazylaa/archive/2009/12/24/5066784.aspx
http://seagar-collection.javaeye.com/blog/297149