java - Struts 1.2 : Unable to load a jsp as Action class isn't called -
i enhancing pre-existed code in struts 1.2. supposed add tab called prcm admin
. have made following entries in main xml files , jsp. have action class method getviewpricemanagementadmin
.
when tried debug code seems control doesn't reach action class @ all.
i have checked calls , looks correct. blank tab loaded in application.
i have shared error on console.
struts-config.xml
<action path="/prcmmgmtadmin" type="mypackage.web.action.prcmadm.prcmmgmtadminaction" name="prcmmgmtform" parameter="methodname" scope="request" validate="false"> <forward name="prcmmgmtadmin" path="prcmmgmtadmin" contextrelative="true" /> </action>
action-servlet.xml
<bean name="/prcmmgmtadmin" class="mypackage.web.action.prcmadm.prcmmgmtadminaction"> </bean>
tiles-def.xml
<definition name="prcmmgmtadmin" extends="template" > <put name="body" value="prcmmgmtadminview" /> </definition> <definition name="prcmmgmtadminview" page="/web-inf/jsp/prcmmgmtadminview.jsp" > </definition>
header.jsp
case "prcmmgmtadmin": window.location = "prcmmgmtadmin.domethodname=getviewpricemanagementadmin"; break;
console output
23:17:23,721 info [stdout] 06-18-2015, 23:17:23721, debug, [org.springframework.jdbc.core.statementcreatorutils], - setting sql statement parameter value: column index 1, parameter value [stat_cd], value class [java.lang.string], sql type 1 23:17:32,236 info [stdout] 06-18-2015, 23:17:32235, error, [mypackage.web.action.prcmadm.prcmmgmtadminaction], - mypackage.web.security.userprincipal@bb51061 23:17:32,237 info [stdout] 06-18-2015, 23:17:32237, error, [mypackage.web.action.prcmadm.prcmmgmtadminaction], - errorpage::null 23:17:32,292 info [stdout] 06-18-2015, 23:17:32287, error, [org.apache.catalina.core.containerbase.[jboss.web].[localhost].[/markdownweb].[jsp]], - servlet.service() servlet jsp threw exception java.lang.nullpointerexception @ org.apache.jsp.web_002dinf.jsp.common.error_jsp._jspservice(error_jsp.java:110) @ org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:70) @ javax.servlet.http.httpservlet.service(httpservlet.java:803) @ org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:387) @ org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:320) @ org.apache.jasper.servlet.jspservlet.service(jspservlet.java:266) @ javax.servlet.http.httpservlet.service(httpservlet.java:803) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.applicationdispatcher.invoke(applicationdispatcher.java:687) @ org.apache.catalina.core.applicationdispatcher.doinclude(applicationdispatcher.java:590) @ org.apache.catalina.core.applicationdispatcher.include(applicationdispatcher.java:505) @ org.apache.jasper.runtime.jspruntimelibrary.include(jspruntimelibrary.java:968) @ org.apache.jasper.runtime.pagecontextimpl.include(pagecontextimpl.java:614) @ org.apache.struts.tiles.tilesutilimpl.doinclude(tilesutilimpl.java:101) @ org.apache.struts.tiles.tilesutil.doinclude(tilesutil.java:137)
of course can't reach action because have wrong url in js code.
case "prcmmgmtadmin": window.location = "prcmmgmtadmin.do?methodname=getviewpricemanagementadmin"; break;
you can use html:rewrite
tag rewrite url in jsp
case "prcmmgmtadmin": window.location = "<html:rewrite action='prcmmgmtadmin'/>"+"?methodname=getviewpricemanagementadmin"; break;
Comments
Post a Comment