我开发一个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
相关文档:
在开发中验证码是比较常用到有效防止这种问题对某一个特定注册用户用特定程序破解方式进行不断的登陆尝试的方式。
此演示程序包括三个文件:
1.login.jsp:登录页面
2.code.jsp:生成验证码图片页面
3.check.jsp:验证结果
code.jsp
程序代码 ==================================================
<%@ page co ......
不处理体内容的标签理解一下图片1
处理体内容标签理解提图片2
1:JspWriter out = pageContext.getOut();
2:BodyContent bc = this.getBodyContent();
3:String input = bc.getString();
4:JspWriter out = bc.getEnclosingWriter();
不处理体内容
第一行代码为不处理标签体内容时拿到需要的输出到页 ......
因为是跟着视频学习的,有很多用的东西不一样,但是还是慢慢的摸索出来啦!
1.Microsoft JDBC Driver 的下载安装
只要在网上找到资源一步步来就可以了。
2.配置环境变量
我用的是tomcat6.0首先配的是
classpath和path,这些都是在配jdk的时候就配过了,所以就不详细说明了,只要将lib和bin文件加入到相关 ......
方法一、
login.html
<html>
<head>
<title>用户登录</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>
<script language="javascript">
&nbs ......