Announcement Announcement Module
Collapse
No announcement yet.
how can i start a web flow? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    That's a possibility. However, you would likely get a message for that once the view attempts rendering. I don't think your flow is even being executed yet, so you should try to tackle that issue first.

    The message you posted earlier seems to have an extra "app" in the URL. Don't know how that's getting in there...

    Comment


    • #17
      Whenever you create a new Spring MVC Sample Project in STS it automatically adds functionality to make url:s more "friendly" looking. I think that's what making those extra /app/.

      urlrewrite.xml:
      Code:
      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
      <urlrewrite default-match-type="wildcard">
      	<rule>
      		<from>/</from>
      		<to>/app/welcome</to>
      	</rule>
      	<rule>
      		<from>/**</from>
      		<to>/app/$1</to>
      	</rule>
      	<outbound-rule>
      		<from>/app/**</from>
      		<to>/$1</to>
      	</outbound-rule>	
      </urlrewrite>
      I've tried adding a controller to trigger the flow but that doesn't seem to work:

      Code:
      @Controller
      public class WebflowController {
      	
      	@RequestMapping("/startflow")
      	public String registrationHandler() {
      		return "/registration";
      	}
      }
      Heh, I'm starting to wonder if webflow is even compatible with Spring 3.0.

      Comment


      • #18
        Didn't realize you were using Spring 3.

        I know SWF 2 wasn't designed with Spring 3 in mind, and vice versa, though some people have had some success on some levels. SWF 3 will likely have full support for Spring 3 compatibility.

        Comment


        • #19
          Originally posted by InverseFalcon View Post
          Didn't realize you were using Spring 3.

          I know SWF 2 wasn't designed with Spring 3 in mind, and vice versa, though some people have had some success on some levels. SWF 3 will likely have full support for Spring 3 compatibility.
          It would be strange if Spring 3 didn't support SWF2, seeing as there really isn't any good mechanism/method in place for moving between spring forms, in a wizard-like way, without that support.

          Comment


          • #20
            Like I said, it kinda supports it. I know there have been conflicts between certain classes/packages between SWF 2 and Spring 3 (see this thread for more).

            SWF 3 is under development, and one of its tasks is to fully integrate with Spring 3 (see the JIRA for milestone 1).

            If I'm reading it correctly, M1 release is this coming Wednesday.

            Comment


            • #21
              Originally posted by InverseFalcon View Post
              Like I said, it kinda supports it. I know there have been conflicts between certain classes/packages between SWF 2 and Spring 3 (see this thread for more).

              SWF 3 is under development, and one of its tasks is to fully integrate with Spring 3 (see the JIRA for milestone 1).

              If I'm reading it correctly, M1 release is this coming Wednesday.
              I started messing around with urlrewrite.xml (I removed the red bit):
              Code:
              <urlrewrite default-match-type="wildcard">
              	<rule>
              		<from>/</from>
              		<to>/app/welcome</to>
              	</rule>
              	<rule>
              		<from>/**</from>
              		<to>/app/$1</to>
              	</rule>
              	<outbound-rule>
              		<from>/app/**</from>
              		<to>/$1</to>
              	</outbound-rule>	
              </urlrewrite>
              ...and something happened (I got an exception, yay!) when I tried navigating to myAppName/app/registration:

              Code:
              java.lang.IllegalArgumentException: Unsupported view type /WEB-INF/flows/registration/step1 only types supported by this FlowViewResolver implementation are [.jsp] and [.jspx]
              Extremly puzzling as step1.jsp most definately is a jsp and it is placed inside WEB-INF/flows/registration

              EDIT: I got it to work! I removed the red part from <view-state id="step1" view="steg"> in my -flow.xml and suddenly my first flow state loaded. Now I'll just have no figure out how to fix the urlrewrite so that it maps /registration to /app/registration. Thanks for all the help InverseFalcon!
              Last edited by Kristofer; Feb 20th, 2010, 08:01 AM.

              Comment


              • #22
                Hmm...

                If I remove the * from the filter-mapping in web.xml I'm able to trigger the flow by adding app/registration to the base url, but then I also have to add app as a prefix whenever I call a controller. Not exactly what I wanted. :-(

                Code:
                <filter-mapping>
                    <filter-name>UrlRewriteFilter</filter-name>
                    <url-pattern>/*</url-pattern>
                </filter-mapping>
                Here are the rules in urlrewrite.xml:
                Code:
                <rule>
                		<from>/</from>
                		<to>/app/welcome</to>
                	</rule>
                	<rule>
                		<from>/**</from>
                		<to>/app/$1</to>
                	</rule>
                	<rule>
                		<from>/styles/**</from>
                		<to>/app/styles/$1</to>
                	</rule>
                	
                	<outbound-rule>
                		<from>/app/**</from>
                		<to>/$1</to>
                	</outbound-rule>
                Is there some smart expression I can use to remove the need to prefix every call with /app/ ?

                Comment


                • #23
                  I've submitted the problem to JIRA

                  Link ... and it seems to be already fixed. I guess we will see the fix in the next STS release.

                  I wonder if there is any way to get the full fix description before that?

                  Best
                  Alex

                  Comment

                  Working...
                  X