我开发一个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();
不处理体内容
第一行代码为不处理标签体内容时拿到需要的输出到页 ......
我的系统使用acegi登录认证,并且配置用户缓存
<!-- 缓存器,为userCacheBackend提供缓存管理。 -->
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
<!-- EhCache一般用途如下:Hibernate缓存,DAO缓存,安全性凭证缓存(Ace ......
学习JSP主要学习他的9大对象(request, response, pageContext, session, application, out, config, page, exception ),这些对象都是静态对象,不用定义就可以直接使用,把他们都了解清楚并会运用,就可以在简历上添上一个熟悉技能:JSP
Jsp内置对象 功能 主要方法
out 向客户端输出数据 print() println() flush() ......
Jsp编码规范
1.1 文件后缀(File Suffixes)
文件类别 文件后缀
--------------------------------------
Java源文件 .java
Java字节码文件 .class
动态页面 .jsp
静态页面 .html
脚本文件 .js
1.2 常用文件名(Common ......