论技术官方似乎确比民间友好,strust之bean:include之感(一)
论技术官方似乎确比民间友好,jstl之c:import之感(二)
案例环境
JBOSS4.0.5GA(Tomcat5.05)关键是Tomcat的版本
案例背景:
1) configure HTTPS visit
operation>> https://[server domain name]/[web-app]/
result>>> some work well, while others not
2)联想:既然部分work well,部分not;那与配置无关。
如果做远程映射访问,是否是这个问题呢?
operation1>>> ssh -C -L 8080:localhost:8080 [username]@[remote server]
result>>> work well
operation2>>>ssh -C -L 12345:localhost:8080 [username]@[remote server]
result>>> some work well, while others not, the same as https
3) 逐行跟踪:
原来是一个
2级跳的问题
以实景分析:
#####a)######
访问 https://localhost/app/journal.do?method=journalView&companyid=001 出错
#####b)######
定位到的出错的语句是:
<bean:include page='<%="/journal.do?method=journalList"%>' id="outputstring"/>
<%=outputstring%>
#####c)######
直接在url里访问这个出错的语句,可以正常显示
https://localhost/app/journal.do?method=journalList
#####d)######
出错的原因
javax.servlet.jsp.JspException: Exception opening resource https://localhost/app/journal.do?method=journalList: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
org.apache.struts.taglib.bean.IncludeTag.doStartTag(IncludeTag.java:255)
org.apache.jsp.ctr.ctrbook.journal.maininfo_jsp._jspService(maininfo_jsp.java:369)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:79)
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
com.jc.cxc.web.filter.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:171)
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
com.justcommodity.cxc.servlets.filters.GeneralFilter.doFilter(GeneralFilter.java:61)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
#####e)分析######
这就是说,一个.do的页面调用另外的.do,导致出的错;而且出错的原因定位到bean:include标签
#####f)解决######
采用JSTL(reference resource: 1 c.tld 2 jstl.jar 3 standard.jar)
JSP头增加 <%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
bean:include标签换成c:import,形式:<c:import url='<%="/journal.do?method=journalList"%>' />
#####g)原因分析######
leave out