Announcement Announcement Module
Collapse
No announcement yet.
How to read an URL parameter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to read an URL parameter

    Hi all,

    I've a flow which shows a JSP page (exchangelist_news.jsp) with a set of records, then clicking on the id of one of these records, it starts a request with the "exchangeCode" parameter attached in the URL.
    It triggers an event (<a href="${flowExecutionUrl}&_eventId=getInstr&exchan geCode=${exchange.exchangeCode}">) which should show a new JSP page (instrlist_news.jsp) with other records filtered by this parameters.


    I can't recover this parameter.

    the flow

    <flow xmlns="http://www.springframework.org/schema/webflow"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/webflow
    http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

    <view-state id="exch_list" view="newsrequest/exchangelist_news">
    <on-render>
    <evaluate expression="instrumentManager.listExchanges()" result="viewScope.exchanges" />
    </on-render>
    <transition on="getInstr" to="instr_list"/>
    </view-state>

    <view-state id="instr_list" view="newsrequest/instrlist_news">
    <on-render>
    <evaluate expression="instrumentManager.listInstrumentsByExc hange(exchangeCode)" result="viewScope.instruments"/>
    </on-render>
    </view-state>
    </flow>





    This is the error.

    //START ERROR
    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.webflow.execution.ActionExecut ionException: Exception thrown executing [AnnotatedAction@1057ce1 targetAction = [EvaluateAction@1002104 expression = instrumentManager.listInstrumentsByExchange(exchan geCode), resultExposer = [ActionResultExposer@177b100 result = viewScope.instruments, resultType = [null]]], attributes = map[[empty]]] in state 'instr_list' of flow 'getNews' -- action execution attributes were 'map[[empty]]'
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:583)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

    root cause

    org.springframework.webflow.execution.ActionExecut ionException: Exception thrown executing [AnnotatedAction@1057ce1 targetAction = [EvaluateAction@1002104 expression = instrumentManager.listInstrumentsByExchange(exchan geCode), resultExposer = [ActionResultExposer@177b100 result = viewScope.instruments, resultType = [null]]], attributes = map[[empty]]] in state 'instr_list' of flow 'getNews' -- action execution attributes were 'map[[empty]]'
    org.springframework.webflow.execution.ActionExecut or.execute(ActionExecutor.java:60)
    org.springframework.webflow.engine.ActionList.exec ute(ActionList.java:155)
    org.springframework.webflow.engine.ViewState.rende r(ViewState.java:280)
    org.springframework.webflow.engine.ViewState.refre sh(ViewState.java:241)
    org.springframework.webflow.engine.ViewState.resum e(ViewState.java:219)
    org.springframework.webflow.engine.Flow.resume(Flo w.java:545)
    org.springframework.webflow.engine.impl.FlowExecut ionImpl.resume(FlowExecutionImpl.java:259)
    org.springframework.webflow.executor.FlowExecutorI mpl.resumeExecution(FlowExecutorImpl.java:163)
    org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.handle(FlowHandlerAdapter.java:183)
    org.springframework.webflow.mvc.servlet.FlowContro ller.handleRequest(FlowController.java:174)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

    root cause

    org.springframework.binding.expression.PropertyNot FoundException: Property not found
    org.springframework.binding.expression.ognl.OgnlEx pression.getValue(OgnlExpression.java:87)
    org.springframework.webflow.action.EvaluateAction. doExecute(EvaluateAction.java:77)
    org.springframework.webflow.action.AbstractAction. execute(AbstractAction.java:188)
    org.springframework.webflow.execution.AnnotatedAct ion.execute(AnnotatedAction.java:145)
    org.springframework.webflow.execution.ActionExecut or.execute(ActionExecutor.java:51)
    org.springframework.webflow.engine.ActionList.exec ute(ActionList.java:155)
    org.springframework.webflow.engine.ViewState.rende r(ViewState.java:280)
    org.springframework.webflow.engine.ViewState.refre sh(ViewState.java:241)
    org.springframework.webflow.engine.ViewState.resum e(ViewState.java:219)
    org.springframework.webflow.engine.Flow.resume(Flo w.java:545)
    org.springframework.webflow.engine.impl.FlowExecut ionImpl.resume(FlowExecutionImpl.java:259)
    org.springframework.webflow.executor.FlowExecutorI mpl.resumeExecution(FlowExecutorImpl.java:163)
    org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.handle(FlowHandlerAdapter.java:183)
    org.springframework.webflow.mvc.servlet.FlowContro ller.handleRequest(FlowController.java:174)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

    root cause

    ognl.NoSuchPropertyException: org.springframework.webflow.engine.impl.RequestCon trolContextImpl.exchangeCode
    ognl.ObjectPropertyAccessor.getProperty(ObjectProp ertyAccessor.java:122)
    org.springframework.webflow.expression.WebFlowOgnl ExpressionParser$RequestContextPropertyAccessor.ge tProperty(WebFlowOgnlExpressionParser.java:118)
    ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1657 )
    ognl.ASTProperty.getValueBody(ASTProperty.java:92)
    ognl.SimpleNode.evaluateGetValueBody(SimpleNode.ja va:170)
    ognl.SimpleNode.getValue(SimpleNode.java:210)
    ognl.ASTMethod.getValueBody(ASTMethod.java:71)
    ognl.SimpleNode.evaluateGetValueBody(SimpleNode.ja va:170)
    ognl.SimpleNode.getValue(SimpleNode.java:210)
    ognl.ASTChain.getValueBody(ASTChain.java:109)
    ognl.SimpleNode.evaluateGetValueBody(SimpleNode.ja va:170)
    ognl.SimpleNode.getValue(SimpleNode.java:210)
    ognl.Ognl.getValue(Ognl.java:333)
    org.springframework.binding.expression.ognl.OgnlEx pression.getValue(OgnlExpression.java:85)
    org.springframework.webflow.action.EvaluateAction. doExecute(EvaluateAction.java:77)
    org.springframework.webflow.action.AbstractAction. execute(AbstractAction.java:188)
    org.springframework.webflow.execution.AnnotatedAct ion.execute(AnnotatedAction.java:145)
    org.springframework.webflow.execution.ActionExecut or.execute(ActionExecutor.java:51)
    org.springframework.webflow.engine.ActionList.exec ute(ActionList.java:155)
    org.springframework.webflow.engine.ViewState.rende r(ViewState.java:280)
    org.springframework.webflow.engine.ViewState.refre sh(ViewState.java:241)
    org.springframework.webflow.engine.ViewState.resum e(ViewState.java:219)
    org.springframework.webflow.engine.Flow.resume(Flo w.java:545)
    org.springframework.webflow.engine.impl.FlowExecut ionImpl.resume(FlowExecutionImpl.java:259)
    org.springframework.webflow.executor.FlowExecutorI mpl.resumeExecution(FlowExecutorImpl.java:163)
    org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.handle(FlowHandlerAdapter.java:183)
    org.springframework.webflow.mvc.servlet.FlowContro ller.handleRequest(FlowController.java:174)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

    //END ERROR


    Please could you suggest ?

    Thanks and best regards,
    Ale

  • #2
    try
    Code:
    <evaluate expression="instrumentManager.listInstrumentsByExchange(requestParameters.exchangeCode)" result="viewScope.instruments"/>

    Comment


    • #3
      SWF uses the POST-REDIRECT-GET pattern for view rendering. This means a redirect occurs (blowing away requestParameters and requestScope) before every view render and execution of on-render actions. You can better work with these scopes in the on-entry section of your view-state.

      See this related thread for more detail.

      Comment

      Working...
      X