易截截图软件、单文件、免安装、纯绿色、仅160KB

javabean向传jsp传值

struts-config:
<action path="/articleManage" name="articleManageForm"  scope="request" type="auction.action.ArticleManageAction" validate="false">
   <forward name="atriclesList" path="/WEB-INF/publish/articleManage/atriclesList.jsp"/>
   <forward name="registerGood" path="/WEB-INF/publish/articleManage/registerGood.jsp"/>
</action>
Action:
ArticleManageForm theForm = new ArticleManageForm ();
theForm = theOperation.getInfo(request.getParameter("noId"));
 request.setAttribute("articleManageForm", theForm);
 1、配置的bean的名称要和struts-config中的一样
 2、在bean中写一个方法,将取出的数据放到相应的bean的变量中


相关文档:

JSP避免Form重复提交的三种方案

  1 Javascript ,设置一个变量,只允许提交一次。
  #lt;script language="javascript"#gt;
   var checkSubmitFlg = false;
   function checkSubmit() {
   if (checkSubmitFlg == true) {
   return false;
   }
   checkSubmitFlg = true;
   return true;
   }
   document.ondblcli ......

jsp上传文件到数据库和从数据库下载文件

用了commons-fileupload-1.2.jar和commons-io-1.3.2.jar这两个包。
save.jsp
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.regex.*"%>
<%@ page import="org.apache.co ......

让html以及jsp页面不被缓存

对于HTM网页,加入:
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
然后,jsp页面中加入:
<%
     response.setHeader("Cache-Control","no-store") ......

js、jsp传递参数乱码问题解决

以前有提到过乱码问题,最近在使用window.open时又出现此类问题,现解决如下:
1:使用encodeURIComponent函数对参数进行处理,例如:window.open("html.jsp?name=" + encodeUrlComponent(value)));
2:修改tomcat服务器的server.xml文件添加:useBodyEncodingForURI="true"或者
URIEncoding=" ......

jsp有哪些内置对象?作用分别是什么?

JSP共有以下9种基本内置组件(可与ASP的6种内部组件相对应):
 1.request 用户端请求,此请求会包含来自GET/POST请求的参数。
   2. response 网页传回用户端的回应 。
   3.pageContext 网页的属性是在这里管理 。
   4.session 与请求有关的会话期。
   5.ap ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号