Jsp中param标签的使用

<jsp:param>操作被用来以“名-值”对的形式为其他标签提供附加信息。它和<jsp:include>、<jsp:forward>、<jsp:plugin>一起使用,方法如下:
    <jsp:param name=”paramName” value=”paramValue”/>其中,name为与属性相关联的关键词,valu...

收藏到:Del.icio.us

关注社会人文焦点 汇聚百万博客看法 欢迎订阅博客大巴《看法》电子报

阅读更多
换一批

struts2的url、param标签使用

04-28

我使用url标签,并通过param标签给它传参数(param里面放的参数是一个对象)会出错,是我取值的方式不对吗?n请大神帮我看看,我是第一次在这里问问题,不太会,有纰漏望指出。n设置参数代码如下:nn nnn取参代码如下:npublic String execute() throws Exception n Task task = (Task) ServletActionContext.getRequest().getAttribute("task");n System.out.println(task.toString());n return "success";n n报的错误信息是:nERROR org.apache.struts2.dispatcher.Dispatcher - Exception occurred during processing request: nullnjava.lang.NullPointerExceptionn at org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69)nat com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)nat org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)nat org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)nat com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)nat org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)nat org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)nat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)nat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)nat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)nat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)nat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)nat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)nat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)nat org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)nat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)nat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)nat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)nat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)nat org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)nat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)nat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)nat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)nat java.lang.Thread.run(Thread.java:745)

没有更多推荐了,返回首页