Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Custom URLs

  1. #11

    Default

    Yes that is a case for urlrewrite rather than urltemplate config:

    http://www.tuckey.org/urlrewrite/manual/3.0/guide.html

    I think your example would be this:

    Code:
    	<rule>
    		<from>/blogs/(.*)</from>
    		<to>/blogs?year=$1</to>
    	</rule>
    	<rule>
    		<from>/blogs/author/(.*)</from>
    		<to>/blogs?author=$1</to>
    	</rule>
    Thanks,

    Kev

  2. #12
    Join Date
    Sep 2010
    Posts
    10

    Default

    Hi again,

    I did what you said, but it keeps saying

    javax.servlet.ServletException: Could not resolve view with name 'blogs/2010' in servlet with name 'Spring MVC Dispatcher Servlet'
    Any ideas?

  3. #13
    Join Date
    Sep 2010
    Posts
    10

    Default

    I can see that the rule is there. If I go to http:localhost:8180/rewrite-status it's in there and everytime I change it it changes, so the rule is deployed

  4. #14

    Default

    I assume you are using something based on the sample app, in which case the rule is probably going to look like this:

    Code:
    	<rule>
    		<from>/blogs/author/(.*)</from>
    		<to>/service/blogs?author=$1</to>
    	</rule>
    	<rule>
    		<from>/blogs/(.*)</from>
    		<to>/service/blogs?year=$1</to>
    	</rule>

  5. #15
    Join Date
    Sep 2010
    Posts
    10

    Default

    Hi Kevin,

    Sorry, yes, I managed to solved it yesterday but forgot updating the post.

    Thanks for the help

  6. #16

    Default

    Excellent news!

    Kev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •