struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert rowntree <rowntree...@yahoo.com>
Subject jsp "path" forward using "success" and mapping not working
Date Thu, 29 Apr 2004 17:40:21 GMT

At the end of a Request from "menu.jsp" im
trying to "loopback" to menu.jsp after 
actionBean updates the FormBean w/ DB querySet.

The reason i want to loopback is to have the menu show
another
section that is based on the "option selected" in a 
drop-down control.

I get as far as an 
exit from the ActionBean's "execute" method, 
having set mapping to "success" before the exception
below

logtrace & struts-config & ActionBean source included
below:

++++++++++++++++++++
stackTrace
++++++++++++++++++++
2004-04-29 08:10:17
StandardContext[/b2bjws]SessionListener:
attributeRemoved('C022C377A506E347E4CA3304F78F570C',
'menuForm', 'com.borneo.beans.MenuForm@baa31b')
2004-04-29 08:10:36
StandardContext[/b2bjws]SessionListener:
attributeAdded('C022C377A506E347E4CA3304F78F570C',
'menuForm', 'com.borneo.beans.MenuForm@11415c8')
2004-04-29 08:10:36 ApplicationDispatcher[/b2bjws]
Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
	at
org.apache.jsp.menu_jsp._jspService(menu_jsp.java:131)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:742)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:506)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:443)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:359)
	at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
	at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
	at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
	at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:509)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
	at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
	at java.lang.Thread.run(Thread.java:534)

2004-04-29 08:10:36 StandardWrapperValve[action]:
Servlet.service() for servlet action threw exception
java.lang.NullPointerException
	at
org.apache.jsp.menu_jsp._jspService(menu_jsp.java:131)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:742)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:506)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:443)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:359)
	at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
	at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
	at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
	at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:509)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
	at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
	at java.lang.Thread.run(Thread.java:534)




++++++++++++++++++++
Debug Statements from StrutsAction class
++++++++++++++++++++

2004-04-29 10:14:42,694 [http80-Processor4] DEBUG
org.apache.struts.util.RequestUtils  - Get module name
for path /mnmenu.do
2004-04-29 10:14:42,694 [http80-Processor4] DEBUG
org.apache.struts.util.RequestUtils  - Module name
found: default
2004-04-29 10:14:42,694 [http80-Processor4] INFO 
org.apache.struts.tiles.TilesRequestProcessor  - Tiles
definition factory found for request processor ''.
2004-04-29 10:14:42,694 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -
Processing a 'POST' for path '/mnmenu'
2004-04-29 10:14:42,694 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -  Setting
user locale 'en_US'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.util.RequestUtils  -  Looking for
ActionForm bean instance in scope 'session' under
attribute key 'menuForm'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.util.RequestUtils  -  Recycling
existing ActionForm instance of class
'com.borneo.beans.MenuForm'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.util.RequestUtils  -  -->
com.borneo.beans.MenuForm@167c5e3
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -  Storing
ActionForm bean instance in scope 'session' under
attribute key 'menuForm'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  - 
Populating bean properties from this request
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.BeanUtils  -
BeanUtils.populate(com.borneo.beans.MenuForm@167c5e3,
{Submit.y=[Ljava.lang.String;@652110,
action=[Ljava.lang.String;@15dc37d,
webappSecurityUser=[Ljava.lang.String;@cd83d8,
Submit.x=[Ljava.lang.String;@8ae59a,
admin_action=[Ljava.lang.String;@e7e8eb})
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.BeanUtils  -  
setProperty(com.borneo.beans.MenuForm@167c5e3,
Submit.y, [9])
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.BeanUtils  -  
setProperty(com.borneo.beans.MenuForm@167c5e3, action,
[Create])
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.ConvertUtils  - Convert
string 'Create' to class 'java.lang.String'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.ConvertUtils  -   Using
converter
org.apache.commons.beanutils.converters.StringConverter@1cb7a1
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.BeanUtils  -  
setProperty(com.borneo.beans.MenuForm@167c5e3,
webappSecurityUser, [dogtown])
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.ConvertUtils  - Convert
string 'dogtown' to class 'java.lang.String'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.ConvertUtils  -   Using
converter
org.apache.commons.beanutils.converters.StringConverter@1cb7a1
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.BeanUtils  -  
setProperty(com.borneo.beans.MenuForm@167c5e3,
Submit.x, [57])
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.BeanUtils  -  
setProperty(com.borneo.beans.MenuForm@167c5e3,
admin_action, [viewsubscription])
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.ConvertUtils  - Convert
string 'viewsubscription' to class 'java.lang.String'
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.commons.beanutils.ConvertUtils  -   Using
converter
org.apache.commons.beanutils.converters.StringConverter@1cb7a1
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  - 
Validating input form properties
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -   No
errors detected, accepting input
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -  Looking
for Action instance for class
com.borneo.beans.ProcessMenuAction
2004-04-29 10:14:42,704 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -  
Creating new Action instance
2004-04-29 10:14:42,714 [http80-Processor4] DEBUG
org.apache.struts.webapp.Example  - ProcessMenuAction:
 Processing viewsubscription Create action
2004-04-29 10:14:42,924 [http80-Processor4] DEBUG
org.apache.struts.webapp.Example  -  Forwarding to
success page
2004-04-29 10:14:42,924 [http80-Processor4] DEBUG
org.apache.struts.tiles.TilesRequestProcessor  -
processForwardConfig(/menu.jsp, false)
2004-04-29 10:14:42,934 [http80-Processor4] DEBUG
org.apache.struts.tiles.xmlDefinition.I18nFactorySet 
- Can't open file '/WEB-INF/tiles-defs_en_US.xml'
2004-04-29 10:14:42,934 [http80-Processor4] DEBUG
org.apache.struts.tiles.xmlDefinition.I18nFactorySet 
- Can't open file '/WEB-INF/tiles-defs_en.xml'
2004-04-29 10:14:42,934 [http80-Processor4] DEBUG
org.apache.struts.tiles.TilesRequestProcessor  -  
'/menu.jsp' - processed as uri
2004-04-29 10:14:42,934 [http80-Processor4] DEBUG
org.apache.struts.action.RequestProcessor  -
processForwardConfig(ForwardConfig[name=success,path=/menu.jsp,redirect=false,contextRelative=false])
2004-04-29 10:14:42,974 [http80-Processor4] DEBUG
org.apache.catalina.core.ApplicationDispatcher  -
servletPath=/menu.jsp, pathInfo=null,
queryString=null, name=null
2004-04-29 10:14:42,974 [http80-Processor4] DEBUG
org.apache.catalina.core.ApplicationDispatcher  - 
Path Based Forward
 
++++++++++++++++++
struts-config
++++++++++++++++++
    <form-beans>

    <!-- Subscription form bean -->
    <form-bean      
      name="subscriptionForm"
      type="com.borneo.beans.SubscriptionForm">
    </form-bean>
    <form-bean      
      name="menuForm"
      type="com.borneo.beans.MenuForm">
    </form-bean>

    </form-beans>

<!-- ================================= Global
Exception Definitions -->

    <global-exceptions>

        <!-- sample exception handler

        <exception

            key="expired.password"

            type="app.ExpiredPasswordException"

            path="/changePassword.jsp"/>

        end sample -->

    </global-exceptions>

<!-- =================================== Global
Forward Definitions -->

    <global-forwards>

        <!-- Default forward to "Welcome" action -->

        <!-- Demonstrates using index.jsp to forward
-->

        <forward

            name="welcome"

            path="/Welcome.do"/>

    </global-forwards>

<!-- =================================== Action
Mapping Definitions -->

    <action-mappings>

            <!-- Default "Welcome" action -->

            <!-- Forwards to Welcome.jsp -->
<!--rcr just added attr below-->
        <action

            path="/Welcome"
name="subscriptionForm"
           
type="org.apache.struts.actions.ForwardAction"
 parameter="/Welcome.jsp"
        />
            <!--          
parameter="/pages/Welcome.jsp"/>-->

    <!-- Edit mail subscription -->
        <!--      fixme  type -->
        <action    path="/editSubscription"
          
         
type="org.apache.struts.webapp.example.EditSubscriptionAction"
          name="subscriptionForm"
          scope="session"
          validate="false">
          <forward name="failure"             
path="/Welcome"/>
          <forward name="success"             
path="/subscription.jsp"/>
        </action>
        
        <!-- Save mail subscription -->
        <action    path="/app"
          
         
type="com.borneo.beans.SaveSubscriptionAction"
          name="subscriptionForm"
          scope="session"
          validate="true"
          input="/subscription.jsp">
          <forward name="success"   
path="/Welcome.do"/>
          <forward name="subscription"   
path="/subscription.jsp"/>
          <!--     <forward name="success"        
path="/Welcome"/> -->
        </action>

<!--testing new adm menu-->
        <action    path="/mnmenu"
          
          type="com.borneo.beans.ProcessMenuAction"
          name="menuForm"         
          scope="session"
          validate="true"
          input="/menu.jsp">
          <forward name="success"   
path="/menu.jsp"/>
          <forward name="subscription"   
path="/subscription.jsp"/>
          <!--     <forward name="success"        
path="/Welcome"/> -->
        </action>        

    </action-mappings>

<!-- ===================================== Controller
Configuration -->

    <controller

      
processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

<!-- ================================ Message
Resources Definitions -->



    <message-resources
parameter="resources.application"/>


<!-- ======================================= Plug Ins
Configuration -->

  <!-- comment following if struts1.0.x -->
  <plug-in
className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" 
	                 value="/WEB-INF/tiles-defs.xml" />
    <set-property property="moduleAware" value="true"
/>
    <set-property
property="definitions-parser-validate" value="true" />
  </plug-in>

  <!-- end comment if struts1.0.x -->

  <plug-in
className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property
        property="pathnames"
       
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
  </plug-in>

</struts-config>

++++++++++++++++++
ProcessMenuAction.java gets to the end of "execute'
method prior to the exception
++++++++++++++++++

	public ActionForward execute(ActionMapping mapping,
				 ActionForm form,
				 HttpServletRequest request,
				 HttpServletResponse response)
	throws Exception {

	// Extract attributes and parameters we will need
	Locale locale = getLocale(request);
	MessageResources messages = getResources(request);
	HttpSession session = request.getSession();
	MenuForm subform = (MenuForm) form;
	if (subform.getAction() == null )
subform.setAction("Create");
	if (log.isDebugEnabled()) {
		log.debug("ProcessMenuAction:  Processing " 
		+ subform.getAdmin_action() + " "
		+ subform.getAction() + " action");
	}
	
	// stateOfMenu is viewMySubs && Select , 
	//   retreive mySubscriptions from DB if needed
	if 
(subform.getAdmin_action().equalsIgnoreCase("viewsubscription")){
		if (subform.getAction().equalsIgnoreCase("Create") )
{
			subform.setAction("Select");
		    subform.setSubscriptionOptions(
		    	this.getUserTopicSub(
		    		subform.getWebappSecurityUser()

				)
			);
		}
	else subform.setSubscriptionOptions(null); // should
go into a ResetForm Meth??
	}
	
	// Remove the obsolete form bean and current menu
	if (mapping.getAttribute() != null) {
		if ("request".equals(mapping.getScope()))
			request.removeAttribute(mapping.getAttribute());
		else
			session.removeAttribute(mapping.getAttribute());
	}

	// Forward control to the specified success URI
	if (log.isTraceEnabled()) {
		log.trace(" Forwarding to success page");
	}
	return (mapping.findForward("success"));  < -- this
is in the log


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message