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

我开发一个jsp系统时碰到的问题

1.No getter method for property name problem(struts)
有一种可能是Bean没有写相应的get方法,例如变量userName的get方法是getUserName;
还有就是这个Bean为空;
2.
MyEclipse的自动添加struts和hibernate功能不能返回,请注意!
所以我先使用MyEclipse导入struts和hibernate,然后将它们的jar导入到另外一个新建的工程,这是我就不需要Myeclipse来给我管理依赖了。
3
.在增加对struts taglib支持时,请将对应的tld文件追加到web.xml文件中去:
例如:
<jsp-config>
  <taglib>
    <taglib-uri>http://struts.apache.org/tags-bean </taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld </taglib-location>
    </taglib>
</jsp-config>
4.
如果出错说某个tag在tld文件中没有,则说明自己在jsp文件中使用的tag和使用的struts taglib版本不一致
例如:在struts1.1中的html:locale,在struts1.2中改为html:lang
5.
struts tag中可以使用scriptlets,但是在scriptlets中不能使用struts tag。
Any Struts tag will work only if you place it directly in the JSP, not if you generate it through a scriptlet. To understand why it won't work to generate it in a scriptlet.
JSP life cycle:
    * The JSP interpreter reads the JSP file, including any custom tags such as Struts tags and converts everything to Java source code
    * It then compiles it into a class file
    * It executes the code, rendering a response in plain HTML and sending it back to the browser.
    * It is only at this point that the scriptlet code you inserted gets executed. It is now too late in the cycle to insert any custom tags, since they've already been interpreted by this point.
6. it is illegal according to JSP specification to nest one tag within another as an attribute.
There are two options:
1) You evaluate bean:write and then substitute it into html:text.
2) Use Struts-EL tags. They let you use expression language to get a bean value and substitute it in another tag.
Unless yo


相关文档:

jsp验证码代码

在开发中验证码是比较常用到有效防止这种问题对某一个特定注册用户用特定程序破解方式进行不断的登陆尝试的方式。
此演示程序包括三个文件:
1.login.jsp:登录页面
2.code.jsp:生成验证码图片页面
3.check.jsp:验证结果
code.jsp
 程序代码 ==================================================
<%@ page co ......

jsp文件下载完整方法

第一种:
就是直接给出下载的地址,这种方式很不好,因为会暴露你的地址,带来很多不安全的因素,可以说是千万不要用这种
第二种:
下载页面
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<html>
<head>
<title>download</title>
</head>
< ......

JSP中文件下载

<%--   
 
有些朋友询问使用 JSP Smart 下载文件的时候报错, 这里给出一个测试过的不  
 
需要使用 JSP Smart 的 JSP 页面中进行文件下载的代码(改 Servlet 或者  
 
JavaBean 的话自己改吧), 支持中文附件名(做了转内码处理). 事实上只要向   ......

jsp几种方法

1.必须继承自HttpServlet
  2.必须实现doGet()或者doPost()
  3.必须在web.xml中配置Servlet
  <servlet>
  <servlet-name> </servlet-name>
  <servlet-class> </servlet-class>
  </servlet>
  <servlet-mapping>
  ......

JSP页面EL表达式无效的问题

 以前用WSAD wizard做的,都可以在JSP页面中解析到EL表达式,当然前提是JSP2.0的情况下。
今天遇到了一个莫名其妙的问题。刚下载Eclipse3.3+MyEclipse6.0体验的过程中,遇上了解析不到EL表达式的问题。经过好几个小时的琢磨终于发现了,给大家share一下:
问题就出在建Web Project的时候web.xml声明上。
web.xml ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号