`
zwh910621
  • 浏览: 147244 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

struts2 奇异的java.lang.NullPointerException

阅读更多

页面a.jsp 

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz"%> 
<%@ taglib prefix="s" uri="/struts-tags"%> 
<% 
String path = request.getContextPath(); 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 
%> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
  <head> 
    <base href="<%=basePath%>"> 
    
    <title>My JSP 'MyJsp.jsp' starting page</title> 
    
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="cache-control" content="no-cache"> 
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 
<meta http-equiv="description" content="This is my page"> 
<!-- 
<link rel="stylesheet" type="text/css" href="styles.css"> 
--> 

  </head> 
  
  <body> 
    <s:include value="b.jsp"></s:include> 
<s:text name="thename"></s:text> 
  </body> 
</html> 
这样就会报 
java.lang.NullPointerException 
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:50) 
at org.apache.jsp.head.a_jsp._jspx_meth_s_005fproperty_005f0(detailAQ_jsp.java:261) 
at org.apache.jsp.head.a_jsp._jspService(detailAQ_jsp.java:153) 
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) 
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) 
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) 
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) 
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) 
at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:139) 
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) 
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) 
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221) 
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150) 
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:186) 
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) 
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) 
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) 
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) 
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) 
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) 
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) 
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) 
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) 
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) 
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) 
at org.tuckey.web.filters.urlrewrite.RewrittenUrl.doRewrite(RewrittenUrl.java:176) 
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:728) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) 
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) 
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:277) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:124) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) 
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) 
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) 
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) 
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) 
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
at java.lang.Thread.run(Unknown Source) 

此错误 
如把 
    <s:include value="b.jsp"></s:include> 
<s:text name="thename"></s:text> 
换一下位置 
写成 
    
<s:text name="thename"></s:text> 
<s:include value="b.jsp"></s:include> 
或 
写成 
<s:include value="b.jsp"></s:include> 
<input type="text"/> 


就不会出问题 

说明:B.JSP是个非常普通的JSP页面,也就是用MYECLIPSE 新建出来的JSP页面,什么都没改


也就是说写了include之后,后面就不能用STRUTS2的标签了,这是为何,如何解决,请各位大哥,帮助,小弟万分感谢

1
3
分享到:
评论
2 楼 zhouwen_8 2010-10-26  
我也碰到了这个问题,如果楼主解决的发邮件告诉我行吗?
1 楼 xiaoqing20 2010-06-09  
保持关注

相关推荐

    应用移植WebSphere问题列表(经验是买不到的)

    1. **数据库插入数据异常**:当遇到`java.lang.NullPointerException`错误,特别是在Oracle JDBC操作中,可能是由于数据源配置或连接池设置不当导致的。解决方案是将连接池的语句高速缓存大小设置为0,这有助于防止...

    struts2-json-plugin-2.3.15.1.jar

    struts2-core-2.xx 升级为struts2-core-2.3.15.1.jar后 jsonplugin-0.32.jar需要升级为 struts2-core-2.3.15.1.jar,不然在使用ajax时候报错 java.lang.NullPointerException at org.apache.jsp.web.error_jsp._jsp...

    struts乱码解决方法

    ### Struts乱码解决方法详解 #### 一、引言 在使用Struts框架进行Web应用开发时,可能会遇到字符编码问题导致的数据显示乱码。本文将详细介绍如何解决Struts项目中的乱码问题,帮助开发者确保数据正确无误地显示。...

    Java开发常见错误及解决方案文件

    2. Java.lang.StackOverflowError错误 - 原因分析:这个错误通常是因为程序中存在无限递归或者过深的递归调用导致栈空间耗尽。 - 解决方案:从程序代码优化方面着手,检查并修正递归调用的逻辑,优化递归次数。 3...

    struts2 全局异常提示定义属性文件使用

    Struts2是一个非常流行的Java Web框架,用于构建和维护可扩展、模块化和灵活的Web应用程序。在Struts2中,处理程序方法可能会抛出各种异常,为了提供统一的错误处理和用户友好的异常提示,我们可以定义全局异常提示...

    ognl.MethodFailedException

    OGNL是一种强大的表达式语言,常用于Java应用程序,特别是Spring MVC和Struts 2框架中,用于数据绑定和动态方法调用。当出现`MethodFailedException`,通常意味着尝试通过OGNL执行的方法未能成功。 **OGNL简介** ...

    Struts2异常处理机制

    Struts2作为一款流行的Java Web框架,其异常处理机制是其核心功能之一,它使得开发者能够优雅地管理和处理应用程序中的异常情况,提供了一种统一的错误处理方式,从而提高用户体验并增强程序的健壮性。 在Struts2...

    struts2中异常处理(demo)

    Struts2是一个非常流行的Java Web框架,用于构建和维护可扩展且易于管理的企业级应用程序。在Struts2中,异常处理是一项重要的功能,它确保了应用程序的健壮性和用户友好的错误反馈。这篇博客文章“Struts2中异常...

    WEB开发报错处理集锦

    2. java.lang.NullPointerException 这是Java中最常见的错误之一,表示某个对象的值为null。解决方法是检查代码中是否存在空指针异常,确保所有对象都被正确初始化。 3. org.apache.struts.action....

    JSP Struts配置文件详解

    &lt;exception exception="java.lang.NullPointerException" key="error.nullpointer"/&gt; &lt;exception exception="java.sql.SQLException" key="error.sql.exception"/&gt; ``` 在此示例中,`&lt;exception&gt;`元素的`...

    使用Spring、Hibernate、Struts的一些错误总结.txt

    java.lang.NullPointerException 这个异常通常意味着代码试图调用一个null对象的方法或属性。在Spring、Hibernate和Struts框架中,这可能发生在依赖注入未正确完成的情况下,例如某个Bean没有被正确实例化,或者...

    struts一些介绍

    &lt;exception className="java.lang.NullPointerException" handler="com.example.CustomExceptionHandler" key="error.nullpointer" path="/error/nullpointer.jsp"/&gt; ``` #### 四、总结 通过对`struts-config....

    Struts1异常处理

    3. **定制化异常类**:Struts1允许开发者创建自定义的异常类,这些异常类可以继承自`java.lang.Exception`或者`java.lang.RuntimeException`。在Action中抛出自定义异常,然后在struts-config.xml中配置对应的异常...

    错误总结.doc

    7. **java.lang.NullPointerException**:当试图访问一个为null的对象或其成员时,会出现这个异常。确保对象已正确初始化(使用`new`关键字),并且在访问数据库列的值时,该值不为null。 8. **java.lang....

    Struts2的异常处理

    Struts2作为一款流行的Java Web框架,其异常处理机制是开发者必须掌握的关键部分。这篇博客主要探讨了在Struts2中如何有效地管理和处理异常,从而提高应用的稳定性和用户体验。 在Struts2中,异常处理主要通过两种...

    必看的java编程面试题(20210925170811).pdf

    `java.lang`包是最基础的包,包含所有Java程序都依赖的基本类,如`String`、`Object`和`System`;`HashMap`和`HashSet`是`java.util`包中的两个常用容器,分别用于存储键值对和不重复的元素。 这些知识点是Java...

    java中常见的错误.docx

    18. NullPointerException:`java.lang.NullPointerException`是Java中最常见的运行时错误,表示尝试访问或操作一个null对象。 19. Servlet异常:`Servlet.service()`方法的异常通常意味着在Servlet处理请求时发生...

    自己所写的java代码

    异常类位于`java.lang.Throwable`层次结构中,如`IOException`, `NullPointerException`等。 4. 多线程:Java支持多线程编程,通过`java.lang.Thread`类或实现`Runnable`接口创建线程。线程间的同步和通信可利用`...

    Struts 声明式异常处理和个性化异常处理

    &lt;exception-mapping exception="java.lang.NullPointerException" result="errorPage"/&gt; ``` 这里的`&lt;exception-mapping&gt;`元素指定了如果遇到`NullPointerException`,框架将跳转到名为`errorPage`的结果页面。...

    configuring struts

    &lt;exception-mapping exception="java.lang.NullPointerException" result="errorPage"/&gt; ``` 这里指定了当出现`NullPointerException`时,应该转向`errorPage`。 ### 全局转发 这一部分将Web应用中的页面映射到...

Global site tag (gtag.js) - Google Analytics