日期:2014-05-18  浏览次数:20570 次

jsp,用存储过程,从textarea提交到数据库,再读出来时,内容显示不完整,朋友们帮帮忙,内详!急!
操作过程中,程序没有异常,但就是显示出来时只显示了一部分文字,这个怎样解决?
===========================================================
存储过程:
CREATE   PROCEDURE   [updateCo]
(@cid_1   [int],
  @content_2   [varchar](1000),
  @title_3 [varchar](100))

AS   UPDATE   [hjtzweb].[dbo].[co_info]  

set   [content]   =   @content_2   ,
        [title]   =   @title_3

WHERE  
(   [cid]   =   @cid_1)
GO
================================================
提交数据库的方法:
public   boolean   modifyCoInfo(HttpServletRequest   req)
{
boolean   flag=false;
String   tempcid=req.getParameter( "cid ");
String   tempcontent=req.getParameter( "c ");
String   temptitle=req.getParameter( "t ");
try
{
con   =   DB.getCon();
CallableStatement   cs=con.prepareCall( "{call   updateCo(?,?,?)} ");
cs.setInt(1,   Integer.parseInt(tempcid));
cs.setString(2,   tempcontent);
cs.setString(3,   temptitle);
int   rst=cs.executeUpdate();
if(rst> 0)   flag=true;
cs.close();
con.close();
}   catch   (Exception   e)
{
System.out.println( "【Co.java-modifyCoInfo()】异常 ");
e.printStackTrace();
}finally{
conClose();
}
return   flag;
}
=========================================================
sqlserver2000   数据结构:



------解决方案--------------------
好办,用newxy的标签 <nbean:write/> ,struts的 <html:write/> 不行,与你如何保存到数据的方法没有关系,这个标签也可输出网页。
  假设内容保存在pageContext中,键名是 "content ",在jsp页面上:
<nhtml:write name= "content " scope= "page "/>
  下面的内容是这个方法实现的:http://www.newxy.net/zh_cn/article.jsp?article_id=1

newxy新坐标网站:http://www.newxy.net